corekit-ui 0.2.0 → 0.2.34

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.
@@ -1,10 +1,10 @@
1
- (function(Y,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("react/jsx-runtime"),require("react"),require("firebase/app"),require("firebase/storage"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","firebase/app","firebase/storage","react-dom"],i):(Y=typeof globalThis<"u"?globalThis:Y||self,i(Y.CoreKitUI={},Y.jsxRuntime,Y.React,Y.app,Y.storage,Y.ReactDOM))})(this,(function(Y,i,m,Ya,et,St){"use strict";function ri(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=ri(m),Ho=ri(St);function ii(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=ii(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function X(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=ii(e))&&(o&&(o+=" "),o+=t);return o}const si=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ai=X,Za=(e,t)=>n=>{var o;if(t?.variants==null)return ai(e,n?.class,n?.className);const{variants:r,defaultVariants:s}=t,a=Object.keys(r).map(u=>{const _=n?.[u],p=s?.[u];if(_===null)return null;const f=si(_)||si(p);return r[u][f]}),l=n&&Object.entries(n).reduce((u,_)=>{let[p,f]=_;return f===void 0||(u[p]=f),u},{}),d=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((u,_)=>{let{class:p,className:f,...c}=_;return Object.entries(c).every(h=>{let[g,v]=h;return Array.isArray(v)?v.includes({...s,...l}[g]):{...s,...l}[g]===v})?[...u,p,f]:u},[]);return ai(e,a,d,n?.class,n?.className)},ve={boton:"_boton_6deb3_1",animated:"_animated_6deb3_83",disabled:"_disabled_6deb3_83",loading:"_loading_6deb3_83",xs:"_xs_6deb3_109",sm:"_sm_6deb3_127",md:"_md_6deb3_145",lg:"_lg_6deb3_159",full_width:"_full_width_6deb3_173",icon_only:"_icon_only_6deb3_181",radius_none:"_radius_none_6deb3_225",radius_sm:"_radius_sm_6deb3_233",radius_md:"_radius_md_6deb3_241",radius_lg:"_radius_lg_6deb3_249",radius_full:"_radius_full_6deb3_257",content:"_content_6deb3_265",spinner:"_spinner_6deb3_267",start_content:"_start_content_6deb3_269",end_content:"_end_content_6deb3_271",content_item:"_content_item_6deb3_283",only_loading:"_only_loading_6deb3_315",spinner_icon:"_spinner_icon_6deb3_335",ripple:"_ripple_6deb3_371",solid:"_solid_6deb3_423",bordered:"_bordered_6deb3_441",ghost:"_ghost_6deb3_461",light:"_light_6deb3_485",faded:"_faded_6deb3_503",shadow:"_shadow_6deb3_523",outline:"_outline_6deb3_567",muted:"_muted_6deb3_591",contrast:"_contrast_6deb3_609",tap_animating:"_tap_animating_6deb3_671",default:"_default_6deb3_679",primary:"_primary_6deb3_689",secondary:"_secondary_6deb3_699",success:"_success_6deb3_709",warning:"_warning_6deb3_719",danger:"_danger_6deb3_729"},Ja=Za(ve.boton,{variants:{variant:{solid:ve.solid,bordered:ve.bordered,ghost:ve.ghost,light:ve.light,faded:ve.faded,shadow:ve.shadow,outline:ve.outline,muted:ve.muted,contrast:ve.contrast},color:{default:ve.default,primary:ve.primary,secondary:ve.secondary,success:ve.success,warning:ve.warning,danger:ve.danger},size:{xs:ve.xs,sm:ve.sm,md:ve.md,lg:ve.lg},radius:{none:ve.radius_none,sm:ve.radius_sm,md:ve.radius_md,lg:ve.radius_lg,full:ve.radius_full},fullWidth:{true:ve.full_width},isIconOnly:{true:ve.icon_only},isLoading:{true:ve.loading},onlyLoading:{true:ve.only_loading},isDisabled:{true:ve.disabled},disableAnimation:{false:ve.animated}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"lg",disableAnimation:!0}}),nn=m.forwardRef(({variant:e="solid",color:t="default",size:n="md",radius:o="lg",fullWidth:r=!1,isLoading:s=!1,onlyLoading:a=!1,isDisabled:l=!1,isIconOnly:d=!1,disableRipple:u=!1,disableAnimation:_=!0,animationTap:p=!1,customColor:f,startContent:c,endContent:h,spinner:g,spinnerPlacement:v="end",permisos:w,permiso:y,children:x,className:k,onClick:L,style:A,type:M="button","aria-label":T,...P},I)=>{const q=y&&w?!w.includes(y):!1,V=l||s||q,S=C=>{if(V){C.preventDefault();return}if(L?.(C),p&&!V&&C.currentTarget instanceof HTMLElement){const F=C.currentTarget;F.classList.remove(ve.tap_animating),F.offsetWidth,F.classList.add(ve.tap_animating),F.addEventListener("animationend",()=>F.classList.remove(ve.tap_animating),{once:!0})}if(u||V||!(C.currentTarget instanceof HTMLElement))return;const z=C.currentTarget,O=document.createElement("span"),W=z.getBoundingClientRect(),G=Math.max(W.width,W.height);O.className=ve.ripple,O.style.width=`${G}px`,O.style.height=`${G}px`,O.style.left=`${C.clientX-W.left}px`,O.style.top=`${C.clientY-W.top}px`,O.addEventListener("animationend",()=>O.remove(),{once:!0}),z.appendChild(O)},b=f?{"--btn-color":f,"--btn-text-color":f,...A}:A,$=Ja({variant:e,color:f?void 0:t,size:n,radius:o,fullWidth:r,isIconOnly:d,isLoading:s,onlyLoading:a,isDisabled:V,disableAnimation:_}),D=s&&i.jsx("span",{className:ve.spinner,"aria-hidden":a?void 0:"true",children:g||i.jsx("span",{className:ve.spinner_icon})}),N=a&&!T?"Cargando":T;return i.jsxs("button",{...P,ref:I,type:M,"aria-label":N,"aria-busy":s,className:X($,k),disabled:V,onClick:S,style:b,children:[v==="start"&&D,c&&!a&&i.jsx("span",{className:X(ve.start_content,ve.content_item),children:c}),x&&!a&&i.jsx("span",{className:ve.content,children:x}),h&&!a&&i.jsx("span",{className:X(ve.end_content,ve.content_item),children:h}),v==="end"&&D]})});nn.displayName="Boton";const In={badge:"_badge_1ojub_1",badge_clickable:"_badge_clickable_1ojub_41",size_xs:"_size_xs_1ojub_65",size_sm:"_size_sm_1ojub_77",size_md:"_size_md_1ojub_89",size_lg:"_size_lg_1ojub_101",size_xl:"_size_xl_1ojub_113",radius_none:"_radius_none_1ojub_125",radius_sm:"_radius_sm_1ojub_133",radius_md:"_radius_md_1ojub_141",radius_lg:"_radius_lg_1ojub_149",radius_full:"_radius_full_1ojub_157",dot:"_dot_1ojub_165",icon:"_icon_1ojub_179",dismiss_button:"_dismiss_button_1ojub_191",variant_solid:"_variant_solid_1ojub_251",color_default:"_color_default_1ojub_259",color_primary:"_color_primary_1ojub_269",color_secondary:"_color_secondary_1ojub_279",color_success:"_color_success_1ojub_289",color_warning:"_color_warning_1ojub_299",color_danger:"_color_danger_1ojub_309",color_info:"_color_info_1ojub_319",color_brand:"_color_brand_1ojub_329",variant_subtle:"_variant_subtle_1ojub_339",variant_outline:"_variant_outline_1ojub_419",variant_soft:"_variant_soft_1ojub_515",badge_custom:"_badge_custom_1ojub_595"},Qa=()=>i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:i.jsx("path",{d:"M2 2L8 8M8 2L2 8"})}),li=({variant:e="solid",color:t="default",size:n="md",radius:o="md",children:r,startIcon:s,endIcon:a,dot:l,dismissible:d,onDismiss:u,customColor:_,className:p="",onClick:f})=>{const c=!!f,h=m.useMemo(()=>{if(!_)return;const w=_,y=`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":y,"--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]},[_,e]),g=[In.badge,In[`size_${n}`],In[`radius_${o}`],In[`variant_${e}`],!_&&In[`color_${t}`],_&&In.badge_custom,c&&In.badge_clickable,p].filter(Boolean).join(" "),v=m.useMemo(()=>_||{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,_]);return i.jsxs("span",{className:g,style:h,onClick:f,role:c?"button":void 0,tabIndex:c?0:void 0,children:[l&&i.jsx("span",{className:In.dot,style:{backgroundColor:v}}),s&&i.jsx("span",{className:In.icon,children:s}),r,a&&i.jsx("span",{className:In.icon,children:a}),d&&i.jsx("button",{type:"button",className:In.dismiss_button,onClick:w=>{w.stopPropagation(),u?.()},"aria-label":"Eliminar badge",children:i.jsx(Qa,{})})]})},Be={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"},Go=m.forwardRef(({isSelected:e,defaultSelected:t=!1,onChange:n,label:o,description:r,size:s="md",color:a="primary",customColor:l,variant:d="default",isDisabled:u=!1,isReadOnly:_=!1,isInvalid:p=!1,isRequired:f=!1,showIcons:c=!1,labelPlacement:h="right",labelPosition:g="inline",justifyEnd:v=!1,children:w,className:y="",...x},k)=>{const[L,A]=m.useState(t),M=m.useId(),T=x.id||M,P=e!==void 0?e:L,I=N=>{if(u||_)return;const C=N.target.checked;e===void 0&&A(C),n&&n(C)},q=w||o,V=[Be.contenedor_toggle,Be[`tam_${s}`],!l&&Be[`color_${a}`],Be[`variante_${d}`],Be[`label_${h}`],Be[`posicion_${g}`],P&&Be.seleccionado,u&&Be.deshabilitado,_&&Be.solo_lectura,p&&Be.invalido,c&&Be.con_iconos,v&&Be.justify_end,y].filter(Boolean).join(" "),S=l?{"--toggle-custom-color":l}:void 0,b=()=>q?i.jsxs("div",{className:Be.contenedor_label,children:[i.jsxs("span",{className:Be.texto_label,children:[q,f&&i.jsx("span",{className:Be.marca_requerido,children:" *"})]}),r&&i.jsx("span",{className:Be.texto_descripcion,children:r})]}):null,$=()=>d!=="moon"?null:i.jsx("div",{className:Be.icono_moon,children:i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",children:i.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"})})}),D=()=>!c||d==="moon"?null:i.jsxs(i.Fragment,{children:[i.jsx("svg",{className:Be.icono_check,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("polyline",{points:"2,6 5,9 10,3"})}),i.jsxs("svg",{className:Be.icono_x,width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[i.jsx("line",{x1:"2",y1:"2",x2:"8",y2:"8"}),i.jsx("line",{x1:"8",y1:"2",x2:"2",y2:"8"})]})]});return i.jsxs("div",{className:V,style:S,children:[g==="top"&&b(),i.jsxs("label",{className:Be.envoltorio_toggle,htmlFor:T,children:[g==="inline"&&h==="left"&&b(),i.jsxs("div",{className:Be.pista_toggle,children:[i.jsx("input",{ref:k,type:"checkbox",id:T,checked:P,disabled:u,readOnly:_,required:f,"aria-invalid":p,className:Be.input,onChange:I,...x}),i.jsx("div",{className:Be.fondo_pista,children:i.jsxs("div",{className:Be.pulgar_toggle,children:[$(),D()]})})]}),g==="inline"&&h==="right"&&b()]})]})});Go.displayName="Toggle";const Ra=({className:e})=>i.jsx("svg",{className:e,width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),ci=({className:e})=>i.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:i.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"})}),el=({className:e})=>i.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M3 7v6h6M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})}),nl=({className:e})=>i.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"})}),tl=({className:e})=>i.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M12 20h9M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})}),ol=({className:e})=>i.jsxs("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"}),i.jsx("path",{d:"M15 19h6"}),i.jsx("path",{d:"M18 16v6"})]}),rl=({className:e})=>i.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M20 6L9 17l-5-5"})}),ae={backdrop:"_backdrop_39ql5_1",visible:"_visible_39ql5_41",modal:"_modal_39ql5_65",cuerpo_modal:"_cuerpo_modal_39ql5_107",encabezado:"_encabezado_39ql5_155",titulo:"_titulo_39ql5_169",boton_cerrar:"_boton_cerrar_39ql5_183",texto_esc:"_texto_esc_39ql5_223",icono_x:"_icono_x_39ql5_237",contenedor_lienzo:"_contenedor_lienzo_39ql5_247",area_firma:"_area_firma_39ql5_257",superficie_lienzo:"_superficie_lienzo_39ql5_271",lienzo:"_lienzo_39ql5_279",lienzo_deshabilitado:"_lienzo_deshabilitado_39ql5_309",barra_acciones:"_barra_acciones_39ql5_319",grupo_izquierda:"_grupo_izquierda_39ql5_339",grupo_derecha:"_grupo_derecha_39ql5_351",separador:"_separador_39ql5_363",boton_accion:"_boton_accion_39ql5_375",contenedor_guardar:"_contenedor_guardar_39ql5_435",boton_texto_con_icono:"_boton_texto_con_icono_39ql5_447",accion_texto:"_accion_texto_39ql5_459",icono_boton_accion:"_icono_boton_accion_39ql5_469",icono:"_icono_39ql5_237",contenedor_consentimiento:"_contenedor_consentimiento_39ql5_495",texto_consentimiento:"_texto_consentimiento_39ql5_509",consentimiento_fila:"_consentimiento_fila_39ql5_525",toggle_consentimiento:"_toggle_consentimiento_39ql5_539",contenedor_subir_oculto:"_contenedor_subir_oculto_39ql5_547",boton_adjuntar:"_boton_adjuntar_39ql5_559",input_archivo:"_input_archivo_39ql5_599",input_validacion_firma:"_input_validacion_firma_39ql5_607",bloque_firma:"_bloque_firma_39ql5_635",bloque_encabezado:"_bloque_encabezado_39ql5_657",bloque_titulo:"_bloque_titulo_39ql5_669",marca_requerido:"_marca_requerido_39ql5_685",bloque_preview:"_bloque_preview_39ql5_695",bloque_preview_imagen:"_bloque_preview_imagen_39ql5_723",bloque_preview_placeholder:"_bloque_preview_placeholder_39ql5_737",bloque_acciones:"_bloque_acciones_39ql5_751",accion_agregar_firma:"_accion_agregar_firma_39ql5_765",accion_eliminar_firma:"_accion_eliminar_firma_39ql5_767"},il=8,sl=1.2,nt=4.2,al=1.8,di=(e,t,n)=>Math.max(t,Math.min(n,e)),ll=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)},ui=e=>Number.isFinite(e)?e:performance.now(),cl=()=>{const e=m.useRef(null),[t,n]=m.useState(!0),[o,r]=m.useState(!1),[s,a]=m.useState([]),l=m.useRef([]),d=m.useRef({color:"#111827",enabled:!0}),u=m.useRef(null),_=m.useRef([]),p=m.useRef(0),f=m.useRef(nt),c=m.useRef(!1),h=m.useCallback(()=>e.current?.getContext("2d")??null,[]),g=m.useCallback(()=>h(),[h]),v=m.useCallback(()=>{const S=e.current,b=h();S&&b&&b.clearRect(0,0,S.width,S.height),n(!0),l.current=[],a([]),_.current=[],u.current=null,f.current=nt,c.current=!1},[h]),w=m.useCallback(()=>{c.current=!0,n(!1)},[]),y=m.useCallback((S,b)=>{const $=Math.max(1,b.t-S.t),N=ll(S,b)/$,z=(nt-N*al)*di(b.pressure||.5,.35,1),O=di(z,sl,nt),G=f.current+(O-f.current)*.25;return f.current=G,G},[]),x=m.useCallback((S,b)=>{S.strokeStyle=d.current.color,S.lineWidth=b,S.lineCap="round",S.lineJoin="round"},[]),k=m.useCallback((S,b)=>{const $=g();if(!$)return;const D=y(S,b);x($,D),$.beginPath(),$.moveTo(S.x,S.y),$.quadraticCurveTo(S.x,S.y,b.x,b.y),$.stroke(),n(!1)},[y,g,x]),L=m.useCallback(S=>{const b=e.current;if(!b)return{pressure:.5,t:performance.now(),x:0,y:0};const $=b.getBoundingClientRect(),D=b.width/$.width,N=b.height/$.height;return{pressure:S.pressure&&S.pressure>0?S.pressure:.5,t:S.timeStamp||performance.now(),x:(S.clientX-$.left)*D,y:(S.clientY-$.top)*N}},[]),A=m.useCallback(S=>{if(!d.current.enabled)return;S.preventDefault();const b=e.current;if(!b)return;b.setPointerCapture(S.pointerId);const $=L(S);r(!0),u.current=$,_.current=[$],p.current=ui(S.timeStamp)},[L]),M=m.useCallback(S=>{if(!o||!d.current.enabled)return;S.preventDefault();const b=ui(S.timeStamp);if(b-p.current<il)return;p.current=b;const $=L(S),D=u.current;D&&(k(D,$),u.current=$,_.current.push($))},[k,o,L]),T=m.useCallback(S=>{if(S&&e.current?.hasPointerCapture(S.pointerId)&&e.current.releasePointerCapture(S.pointerId),o&&_.current.length>0){const b=[...l.current,{puntos:[..._.current]}];l.current=b,a(b)}r(!1),u.current=null,_.current=[]},[o]),P=m.useCallback((S,b,$)=>{if(!(b.puntos.length<2))for(let D=1;D<b.puntos.length;D++){const N=b.puntos[D-1],C=b.puntos[D],z=y(N,C);S.strokeStyle=$??d.current.color,S.lineWidth=z,S.lineCap="round",S.lineJoin="round",S.beginPath(),S.moveTo(N.x,N.y),S.quadraticCurveTo(N.x,N.y,C.x,C.y),S.stroke()}},[y]),I=m.useCallback(()=>{if(l.current.length===0)return;const S=l.current.slice(0,-1);l.current=S,a(S);const b=e.current;if(!b)return;const $=h();$&&($.clearRect(0,0,b.width,b.height),f.current=nt,S.forEach(D=>P($,D)),n(S.length===0&&!c.current))},[h,P]),q=m.useCallback((S={})=>{const b=e.current;if(!b||t&&l.current.length===0&&!c.current)return null;const{backgroundColor:$,format:D,quality:N,strokeColor:C}=S;if(!$&&!C)return b.toDataURL("image/png");const z=document.createElement("canvas");z.width=b.width,z.height=b.height;const O=z.getContext("2d");if(!O)return null;$&&(O.fillStyle=$,O.fillRect(0,0,z.width,z.height)),C&&l.current.length>0&&!c.current?(f.current=nt,l.current.forEach(F=>P(O,F,C))):O.drawImage(b,0,0);const W=D??"image/png",G=N??.85;return W==="image/png"?z.toDataURL(W):z.toDataURL(W,G)},[t,P]),V=m.useCallback(S=>{const b=e.current,$=h();if(!b||!$)return;if(d.current={color:S.color,enabled:S.enabled??!0},b.style.touchAction="none",b.style.userSelect="none",!d.current.enabled)return()=>{};const D=O=>A(O),N=O=>M(O),C=O=>T(O),z=O=>T(O);return b.addEventListener("pointerdown",D,{passive:!1}),b.addEventListener("pointermove",N,{passive:!1}),b.addEventListener("pointerup",C,{passive:!1}),b.addEventListener("pointerleave",C,{passive:!1}),b.addEventListener("pointercancel",z,{passive:!1}),()=>{b.removeEventListener("pointerdown",D),b.removeEventListener("pointermove",N),b.removeEventListener("pointerup",C),b.removeEventListener("pointerleave",C),b.removeEventListener("pointercancel",z)}},[T,A,M,h]);return m.useEffect(()=>{f.current=nt},[s.length]),{canvasRef:e,configurarCanvas:V,deshacerUltimoTrazo:I,estaVacio:t,limpiarCanvas:v,marcarConContenido:w,obtenerDatosFirma:q,puedeDeshacer:s.length>0}},fi=m.forwardRef(({alto:e=200,ancho:t=700,aspectRatio:n,className:o,closeOnBackdropClick:r=!1,firmaInicial:s=null,isOpen:a=!1,isRequired:l=!1,mostrarBotonSubir:d=!0,name:u,onClose:_,onConfirm:p,readonly:f=!1,readonlyPostGuardado:c=!1,requiredMessage:h="Se debe registrar una firma para continuar",textoAdjuntar:g="Adjuntar firma",textoConsentimiento:v="Al firmar, confirmo que he leído y acepto todos los términos contractuales",textoDeshacer:w="Deshacer",textoEliminarFirma:y="Eliminar firma",textoEstadoGuardada:x="Guardada",textoEstadoPendiente:k="Pendiente",textoGuardar:L="Guardar firma",textoLimpiar:A="Limpiar",textoModificar:M="Modificar firma",textoReemplazarFirma:T="Reemplazar firma",textoSolicitarFirma:P="Agregar firma",tituloBloque:I="Firma del responsable",titulo:q="Firmar el contrato",mostrarBotonAgregarFirma:V=!0,mostrarBotonEliminarFirma:S=!0,firebasePath:b,firebaseStorage:$,onFirebaseUploadSuccess:D,onFirebaseUploadError:N,fondoTransparente:C=!0},z)=>{const{canvasRef:O,configurarCanvas:W,deshacerUltimoTrazo:G,estaVacio:F,limpiarCanvas:j,marcarConContenido:B,obtenerDatosFirma:te,puedeDeshacer:Z}=cl(),R=m.useRef(null),ge=m.useRef(null),fe=m.useRef(null),Ce=m.useId(),Q=`${Ce}-toggle`,se=`${Ce}-texto`,re=`${Ce}-dialog-title`,be=`${Ce}-dialog-description`,[le,ne]=m.useState(!!a),[ue,we]=m.useState(!1),[oe,ye]=m.useState(s),[U,H]=m.useState(t),[K,ie]=m.useState(!1),[pe,he]=m.useState(!!s),[en,Xe]=m.useState(!1),[De,Fe]=m.useState(!1),rn=Math.round(U*e/Math.max(1,t)),ke=f||c&&pe,me=!f&&!(c&&pe),xe=m.useCallback(Ie=>{const $e=O.current,Ue=$e?.getContext("2d");if(!$e||!Ue)return;const Sn=new Image;Sn.onload=()=>{Ue.clearRect(0,0,$e.width,$e.height);const Ln=$e.width/$e.height,ut=Sn.width/Sn.height;let Gt=$e.width,$t=$e.height,Vo=0,qo=0;ut>Ln?($t=$e.width/ut,qo=($e.height-$t)/2):(Gt=$e.height*ut,Vo=($e.width-Gt)/2),Ue.drawImage(Sn,Vo,qo,Gt,$t),B(),Xe(!0)},Sn.src=Ie},[O,B]),je=m.useCallback(()=>{if($&&typeof $=="object")return $;if(!Ya.getApps().length)throw new Error("Firebase no esta inicializado. Inicializa la app y el almacenamiento antes de usar firebasePath o pasa firebaseStorage al componente.");return et.getStorage()},[$]),Ae=m.useCallback(()=>{j(),ye(null),Xe(!1),he(!1)},[j]),xn=m.useCallback(()=>{ke||(j(),Xe(!1))},[ke,j]),Le=m.useCallback(async()=>{if(ke||De)return;const Ie=je(),$e=typeof oe=="string"&&/^https?:\/\//i.test(oe)?et.ref(Ie,oe):b?et.ref(Ie,b):null;try{$e&&(Fe(!0),await et.deleteObject($e)),Ae(),p?.("")}catch(Ue){if(typeof Ue=="object"&&Ue!==null&&"code"in Ue&&String(Ue.code)==="storage/object-not-found"){Ae(),p?.("");return}console.error("Error al eliminar la firma de Firebase:",Ue),N?.(Ue instanceof Error?Ue:new Error(String(Ue)))}finally{$e&&Fe(!1)}},[ke,oe,b,je,Ae,p,N,De]),Ye=m.useCallback(()=>{f||(j(),he(!1),Xe(!1),ie(!1))},[j,f]),$n=m.useCallback(Ie=>{if(ke)return;const $e=Ie.target.files?.[0];if(!$e)return;const Ue=new FileReader;Ue.onload=Sn=>{const Ln=Sn.target?.result;typeof Ln=="string"&&(j(),xe(Ln))},Ue.readAsDataURL($e)},[ke,xe,j]),We=m.useCallback(()=>{ke||R.current?.click()},[ke]),_e=m.useCallback(()=>{ie(!1),Xe(!1),j()},[j]),Ee=m.useCallback(Ie=>{ue||(we(!0),setTimeout(()=>{ne(!1),we(!1),Ie?.()},400))},[ue]),sn=m.useCallback(()=>{Ee(()=>{_e(),_?.()})},[Ee,_e,_]),Ke=m.useCallback(async()=>{if(ke||ue||De)return;const Ie=te(C?{format:"image/png",strokeColor:"#111827"}:{backgroundColor:"#ffffff",format:"image/jpeg",quality:.82,strokeColor:"#111827"});if(!Ie||!K)return;let $e=Ie;try{if(b){Fe(!0);const Ue=je();let Sn;try{Sn=et.ref(Ue,b)}catch(Ln){const ut=Ln instanceof Error?Ln.message:String(Ln);throw new Error(`No se pudo crear la referencia de Firebase Storage para "${b}". Posible conflicto por dos copias de Firebase (la app y la libreria). Verifica que firebase este externalizado en corekit-ui y que la app use una sola instancia del SDK. Detalle: ${ut}`)}await et.uploadString(Sn,Ie,"data_url"),$e=await et.getDownloadURL(Sn),D?.($e)}Ee(()=>{ye($e),he(!0),p?.($e),_e(),_?.()})}catch(Ue){console.error("Error al subir la firma a Firebase:",Ue),N?.(Ue instanceof Error?Ue:new Error(String(Ue)))}finally{b&&Fe(!1)}},[ke,ue,De,te,C,K,b,Ee,je,D,p,_e,_,N]);m.useEffect(()=>{a&&(ne(!0),we(!1))},[a]),m.useEffect(()=>{ye(s),he(!!s)},[s]),m.useEffect(()=>{if(!le)return;const Ie=()=>{const $e=fe.current;$e&&H(Math.max(1,Math.floor($e.clientWidth)))};return Ie(),window.addEventListener("resize",Ie),()=>window.removeEventListener("resize",Ie)},[t,le]),m.useImperativeHandle(z,()=>({limpiar:j,obtenerDatosFirma:te,estaVacio:()=>F}),[F,j,te]),m.useEffect(()=>{if(!le)return;const Ie=W({color:"#111827",enabled:!ke});return()=>{Ie?.()}},[ke,W,le]),m.useEffect(()=>{if(!le){document.body.style.overflow="";return}const Ie=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",Ie>0&&(document.body.style.paddingRight=`${Ie}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[le]),m.useEffect(()=>{le||_e()},[_e,le]),m.useEffect(()=>{if(!le)return;const Ie=$e=>{if($e.key==="Escape"){sn();return}if($e.ctrlKey&&$e.key.toLowerCase()==="z"){$e.preventDefault(),!ke&&Z&&G();return}$e.ctrlKey&&$e.key==="Enter"&&($e.preventDefault(),ke||Ke())};return document.addEventListener("keydown",Ie),()=>document.removeEventListener("keydown",Ie)},[ke,G,sn,Ke,le,Z]),m.useEffect(()=>{const Ie=ge.current;if(!Ie)return;if(l&&!!!oe){Ie.setCustomValidity(h);return}Ie.setCustomValidity("")},[oe,l,h]);const bn=m.useCallback(Ie=>{ue||!r||Ie.target===Ie.currentTarget&&sn()},[r,ue,sn]),hn=ke,ti=ke||en,Ht=ke||!pe&&(F&&!en||!K),oi=()=>{f||(oe&&Ye(),we(!1),ne(!0))};return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:`${ae.bloque_firma} ${o||""}`,children:[i.jsxs("div",{className:ae.bloque_encabezado,children:[i.jsxs("span",{className:ae.bloque_titulo,children:[I,l&&i.jsx("span",{className:ae.marca_requerido,"aria-hidden":"true",children:"*"})]}),i.jsx(li,{color:oe?"success":"warning",size:"sm",variant:"outline",children:oe?x:k})]}),i.jsxs("div",{className:ae.bloque_preview,style:n?{aspectRatio:n}:void 0,children:[(l||u)&&i.jsx("input",{ref:ge,className:ae.input_validacion_firma,"aria-hidden":"true",name:u,required:l,tabIndex:-1,type:"text",value:oe?"signed":"",onChange:()=>{},onInvalid:Ie=>{l&&!oe&&Ie.currentTarget.setCustomValidity(h)},onInput:Ie=>{Ie.currentTarget.setCustomValidity("")}}),oe?i.jsx("img",{src:oe,alt:"Firma guardada",className:ae.bloque_preview_imagen}):i.jsx("span",{className:ae.bloque_preview_placeholder,children:"Sin firma registrada"})]}),!f&&(V||S&&!!oe)&&i.jsxs("div",{className:ae.bloque_acciones,children:[V&&i.jsx(nn,{color:"primary",size:"sm",variant:"solid",onClick:oi,className:ae.accion_agregar_firma,isDisabled:ke||ue,children:i.jsxs("span",{className:ae.boton_texto_con_icono,children:[oe?i.jsx(tl,{className:ae.icono_boton_accion}):i.jsx(ol,{className:ae.icono_boton_accion}),i.jsx("span",{className:ae.accion_texto,children:oe?T:P})]})}),S&&oe&&i.jsx(nn,{color:"danger",size:"sm",variant:"bordered",onClick:Le,className:ae.accion_eliminar_firma,isDisabled:ke||ue||De,children:i.jsxs("span",{className:ae.boton_texto_con_icono,children:[i.jsx(ci,{className:ae.icono_boton_accion}),i.jsx("span",{className:ae.accion_texto,children:y})]})})]})]}),le&&i.jsx("div",{className:`${ae.backdrop} ${ue?"":ae.visible}`,onClick:bn,children:i.jsxs("div",{className:`${ae.modal} ${ue?"":ae.visible}`,role:"dialog","aria-modal":"true","aria-labelledby":re,"aria-describedby":be,children:[i.jsxs("header",{className:ae.encabezado,children:[i.jsx("h2",{id:re,className:ae.titulo,children:q}),i.jsxs("button",{className:ae.boton_cerrar,onClick:sn,type:"button","aria-label":"Cerrar",children:[i.jsx("span",{className:ae.texto_esc,children:"ESC"}),i.jsx(Ra,{className:ae.icono_x})]})]}),i.jsxs("div",{className:ae.cuerpo_modal,children:[i.jsx("div",{className:ae.contenedor_lienzo,ref:fe,children:i.jsxs("div",{className:ae.area_firma,children:[i.jsx("div",{className:ae.superficie_lienzo,children:i.jsx("canvas",{ref:O,className:`${ae.lienzo} ${hn?ae.lienzo_deshabilitado:""}`,width:U,height:rn,style:{height:`${rn}px`,pointerEvents:ti?"none":"auto",width:"100%"},"aria-label":"Area de firma"})}),me&&i.jsxs("div",{className:ae.barra_acciones,role:"toolbar","aria-label":"Herramientas de firma",children:[i.jsxs("div",{className:ae.grupo_izquierda,children:[i.jsxs("button",{className:ae.boton_accion,onClick:G,type:"button",disabled:!Z||hn,"aria-label":w,children:[i.jsx(el,{className:ae.icono,"aria-hidden":"true"}),i.jsx("span",{children:w})]}),i.jsx("span",{className:ae.separador,"aria-hidden":"true",children:"|"}),i.jsxs("button",{className:ae.boton_accion,onClick:xn,type:"button",disabled:F&&!en||hn,"aria-label":A,children:[i.jsx(ci,{className:ae.icono,"aria-hidden":"true"}),i.jsx("span",{children:A})]})]}),d&&i.jsx("div",{className:ae.grupo_derecha,children:i.jsxs("button",{className:ae.boton_adjuntar,onClick:We,type:"button",disabled:ke,children:[i.jsx(nl,{className:ae.icono,"aria-hidden":"true"}),g]})})]})]})}),me&&i.jsxs(i.Fragment,{children:[i.jsx("div",{id:be,className:ae.contenedor_consentimiento,children:i.jsxs("div",{className:ae.consentimiento_fila,children:[i.jsx(Go,{id:Q,isSelected:K,onChange:ie,color:"primary",size:"md",isDisabled:ke,"aria-describedby":se,className:ae.toggle_consentimiento}),i.jsx("label",{htmlFor:Q,id:se,className:ae.texto_consentimiento,children:v})]})}),i.jsx("div",{className:ae.contenedor_guardar,children:i.jsx(nn,{color:"primary",variant:"solid",size:"md",onClick:pe&&!c?Ye:Ke,type:"button",isLoading:De,isDisabled:Ht||De,startContent:De?void 0:i.jsx(rl,{className:ae.icono,"aria-hidden":"true"}),children:De?"Guardando...":pe&&!c?M:L})})]}),me&&d&&i.jsx("div",{className:ae.contenedor_subir_oculto,children:i.jsx("input",{ref:R,type:"file",accept:"image/*",className:ae.input_archivo,onChange:$n,"aria-label":"Subir imagen de firma"})})]})]})})]})});fi.displayName="Signature";const dl="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Wt=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=dl[n[e]&63];return t};const ul=({size:e="1em",...t})=>i.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:[i.jsx("path",{d:"M18 6 6 18"}),i.jsx("path",{d:"m6 6 12 12"})]}),fl=({size:e="1em",...t})=>i.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:[i.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"}),i.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),_l=({size:e="1em",...t})=>i.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:[i.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"}),i.jsx("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),i.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"}),i.jsx("path",{d:"m2 2 20 20"})]}),He={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"},_i=m.forwardRef((e,t)=>{const{type:n="text",value:o,defaultValue:r,placeholder:s,variant:a="bordered",color:l="default",size:d="md",radius:u="md",fullWidth:_=!0,disableAnimation:p=!1,label:f,description:c,errorMessage:h,startContent:g,endContent:v,isRequired:w=!1,isReadOnly:y=!1,isDisabled:x=!1,isClearable:k=!1,isInvalid:L,validationState:A,validate:M,className:T,classNames:P,style:I,onChange:q,onClear:V,onValueChange:S,onFocus:b,onBlur:$,onKeyDown:D,id:N,name:C,autoComplete:z,autoFocus:O,maxLength:W,minLength:G,pattern:F,...j}=e,B=m.useRef(null),Z=m.useRef(N??`input-text-${Wt(8)}`).current;m.useImperativeHandle(t,()=>B.current);const R=o!==void 0,[ge,fe]=m.useState(r??""),Ce=R?o:ge,[Q,se]=m.useState(!1),[re,be]=m.useState(!1),le=m.useMemo(()=>{if(!M)return null;const xe=M(Ce);return xe===!0||xe==null?null:typeof xe=="string"?xe:typeof xe=="object"&&"message"in xe?xe.message??"Entrada inválida":"Entrada inválida"},[Ce,M]),ne=m.useMemo(()=>L!==void 0?L:A==="invalid"?!0:A==="valid"?!1:!!le,[L,A,le]),ue=A==="valid"&&!ne,we={invalido:ne,mensaje:le},oe=Ce.length>0,ye=n==="password",U=ye&&re?"text":n,H=k&&oe&&!y&&!x,K=m.useCallback(xe=>{if(x||y)return;const je=xe.target.value;R||fe(je),q?.(je),S?.(je)},[R,x,y,q,S]),ie=m.useCallback(xe=>{se(!0),b?.(xe)},[b]),pe=m.useCallback(xe=>{se(!1),$?.(xe)},[$]),he=m.useCallback(()=>{x||y||(R||fe(""),q?.(""),S?.(""),V?.(),B.current?.focus())},[R,x,y,q,S,V]),en=m.useCallback(xe=>{xe.key==="Escape"&&k&&oe&&he(),D?.(xe)},[k,oe,he,D]),Xe=m.useCallback(()=>{be(xe=>!xe),requestAnimationFrame(()=>B.current?.focus())},[]),De=c?`${Z}-desc`:void 0,Fe=ne?`${Z}-err`:void 0,rn=[De,Fe].filter(Boolean).join(" ")||void 0,ke=typeof h=="function"?h(we):h??le,me=X(He.contenedor_base,He[`variante_${a}`],He[`tam_${d}`],He[`radio_${u}`],He[`color_${l}`],{[He.ancho_total]:_,[He.sin_animacion]:p,[He.deshabilitado]:x,[He.solo_lectura]:y,[He.invalido]:ne,[He.valido]:ue,[He.enfocado]:Q,[He.tiene_contenido]:oe},T,P?.base);return i.jsxs("div",{className:me,style:I,children:[f&&i.jsxs("label",{className:X(He.etiqueta,P?.label),htmlFor:Z,children:[f,w&&i.jsx("span",{className:He.marca_requerido,"aria-hidden":"true",children:"*"})]}),i.jsxs("div",{className:X(He.envoltorio_input,P?.inputWrapper),children:[g&&i.jsx("span",{className:He.contenido_inicio,children:g}),i.jsx("div",{className:X(He.envoltorio_interno,P?.innerWrapper),children:i.jsx("input",{...j,ref:B,id:Z,name:C,type:U,value:R?Ce:void 0,defaultValue:R?void 0:r,placeholder:s,disabled:x,readOnly:y,required:w,autoComplete:z,autoFocus:O,maxLength:W,minLength:G,pattern:F,"aria-invalid":ne||void 0,"aria-describedby":rn,"aria-required":w,className:X(He.entrada,P?.input),onChange:K,onFocus:ie,onBlur:pe,onKeyDown:en})}),H&&i.jsx("button",{type:"button",className:X(He.boton_limpiar,P?.clearButton),onClick:he,tabIndex:-1,"aria-label":"Limpiar campo",children:i.jsx(ul,{size:"0.75em"})}),ye&&i.jsx("button",{type:"button",className:He.boton_password,onClick:Xe,tabIndex:-1,"aria-label":re?"Ocultar contraseña":"Mostrar contraseña","aria-pressed":re,children:re?i.jsx(_l,{}):i.jsx(fl,{})}),v&&i.jsx("span",{className:He.contenido_final,children:v})]}),c&&!ne&&i.jsx("div",{id:De,className:X(He.descripcion,P?.description),children:c}),ne&&ke&&i.jsx("div",{id:Fe,className:X(He.mensaje_error,P?.errorMessage),role:"alert",children:ke})]})});_i.displayName="InputText";function tt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kt(e,t){if(e==null||Number.isNaN(e))return"";const{separadorMiles:n=!1,separadorDecimal:o=".",escalaDecimal:r,decimalesFijos:s=!1,prefijo:a="",sufijo:l=""}=t;let d;r!==void 0?d=s?e.toFixed(r):String(Math.round(e*Math.pow(10,r))/Math.pow(10,r)):d=String(e);const[u,_]=d.split(".");let p=u;if(n){const c=typeof n=="string"?n:",";p=u.replace(/\B(?=(\d{3})+(?!\d))/g,c)}let f=p;return _!==void 0?f+=o+_:s&&r&&r>0&&(f+=o+"0".repeat(r)),`${a}${f}${l}`}function gi(e,t){if(!e||e.trim()==="")return;const{separadorMiles:n=!1,separadorDecimal:o=".",prefijo:r="",sufijo:s="",permitirNegativo:a=!0}=t;let l=e;if(r&&(l=l.replace(new RegExp(`^${tt(r)}`),"")),s&&(l=l.replace(new RegExp(`${tt(s)}$`),"")),n){const u=typeof n=="string"?n:",";l=l.replace(new RegExp(tt(u),"g"),"")}o!=="."&&(l=l.replace(new RegExp(tt(o)),".")),a||(l=l.replace(/-/g,""));const d=parseFloat(l);return Number.isNaN(d)?void 0:d}function Wo(e,t,n){let o=e;return t!==void 0&&o<t&&(o=t),n!==void 0&&o>n&&(o=n),o}function pi(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 hi(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}function gl(e,t){if(!e)return e;const{separadorMiles:n=!1,separadorDecimal:o=".",escalaDecimal:r,decimalesFijos:s=!1,prefijo:a="",sufijo:l=""}=t,d=e.startsWith("-"),u=d?e.slice(1):e,[_,p]=u.split(o);let f=p??"";r!==void 0&&(f=f.slice(0,r),s&&(f=f.padEnd(r,"0")));let c=_||"";if(n&&c){const g=typeof n=="string"?n:",";c=c.replace(/\B(?=(\d{3})+(?!\d))/g,g)}let h=(d?"-":"")+c;return p!==void 0?h+=o+f:s&&r&&r>0&&(h+=o+"0".repeat(r)),`${a}${h}${l}`}function mi(e,t){const{separadorMiles:n,prefijo:o="",sufijo:r=""}=t;let s=e;if(o&&(s=s.replace(new RegExp(`^${tt(o)}`),"")),r&&(s=s.replace(new RegExp(`${tt(r)}$`),"")),n){const a=typeof n=="string"?n:",";s=s.replace(new RegExp(tt(a),"g"),"")}return s}const pl=e=>i.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:[i.jsx("path",{d:"M5 12h14"}),i.jsx("path",{d:"M12 5v14"})]}),hl=e=>i.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:i.jsx("path",{d:"M5 12h14"})}),Ge={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"},vi=m.forwardRef((e,t)=>{const{value:n,defaultValue:o,placeholder:r,variant:s="bordered",color:a="default",size:l="md",radius:d="md",fullWidth:u=!0,disableAnimation:_=!1,label:p,description:f,errorMessage:c,startContent:h,endContent:g,isRequired:v=!1,isReadOnly:w=!1,isDisabled:y=!1,isInvalid:x,validationState:k,validate:L,className:A,classNames:M,style:T,min:P,max:I,step:q=1,decimalScale:V,fixedDecimalScale:S=!1,thousandSeparator:b=!1,decimalSeparator:$=".",prefix:D="",suffix:N="",allowNegative:C=!0,allowDecimal:z=!0,hideControls:O=!1,clampBehavior:W="error",onChange:G,onValueChange:F,onFocus:j,onBlur:B,onKeyDown:te,id:Z,name:R,...ge}=e,fe=m.useRef(null),Q=m.useRef(Z??`input-numeric-${Wt(8)}`).current;m.useImperativeHandle(t,()=>fe.current);const se=n!==void 0,[re,be]=m.useState(o),[le,ne]=m.useState(""),[ue,we]=m.useState(!1),oe=se?n===""?void 0:n:re,ye=m.useMemo(()=>({separadorMiles:b,separadorDecimal:$,escalaDecimal:z?V:0,decimalesFijos:S,prefijo:D,sufijo:N,permitirNegativo:C}),[b,$,V,S,D,N,C,z]),U=m.useRef(oe);U.current=oe;const H=m.useRef(ye);H.current=ye;const K=m.useRef(ue);K.current=ue;const ie=m.useRef(""),pe=m.useMemo(()=>{if(W==="error"&&oe!==void 0){if(P!==void 0&&oe<P)return`El valor debe ser mayor o igual a ${P}`;if(I!==void 0&&oe>I)return`El valor debe ser menor o igual a ${I}`}if(!L)return null;const _e=pi(L(oe));return _e.invalido?_e.mensaje:null},[oe,L,W,P,I]),he=m.useMemo(()=>x!==void 0?x:k==="invalid"?!0:k==="valid"?!1:!!pe,[x,k,pe]),en=k==="valid"&&!he,Xe={invalido:he,mensaje:pe},De=m.useCallback(_e=>{se||be(_e),G?.(_e),F?.(kt(_e,ye),_e)},[se,G,F,ye]),Fe=m.useCallback(_e=>{let Ee=(oe??0)+q*_e;W!=="error"&&(Ee=Wo(Ee,P,I)),V!==void 0&&(Ee=hi(Ee,V)),De(Ee),ne(kt(Ee,ye))},[oe,q,P,I,W,V,De,ye]),rn=m.useCallback(_e=>{if(y||w)return;const Ee=$===","?",":".";let sn="0-9";z&&(sn+=Ee),C&&(sn+="-");let Ke=_e.target.value.replace(new RegExp(`[^${sn}]`,"g"),"");if(z){const bn=Ke.split(Ee);bn.length>2&&(Ke=bn[0]+Ee+bn.slice(1).join(""))}if(C&&Ke.includes("-")){const bn=Ke.replace(/-/g,"");Ke=Ke.startsWith("-")?"-"+bn:bn}ie.current=Ke,ne(Ke),De(gi(Ke,ye))},[y,w,ye,De,$,C,z]),ke=m.useCallback(_e=>{const Ee=mi(ie.current,H.current);ie.current=Ee,we(!0),Ee&&ne(Ee),j?.(_e)},[j]),me=m.useCallback(_e=>{const Ee=U.current,sn=H.current;if(we(!1),W==="blur"&&Ee!==void 0){const Ke=Wo(Ee,P,I);if(Ke!==Ee){De(Ke),ne(kt(Ke,sn)),B?.(_e);return}}W!=="error"&&ne(gl(ie.current,sn)),B?.(_e)},[W,P,I,De,B]),xe=m.useCallback(_e=>{_e.key==="ArrowUp"?(_e.preventDefault(),Fe(1)):_e.key==="ArrowDown"&&(_e.preventDefault(),Fe(-1));const Ee=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],sn=_e.ctrlKey||_e.metaKey,Ke=z&&(_e.key===$||_e.key==="."||_e.key===","),bn=_e.key==="-"&&C,hn=/^[0-9]$/.test(_e.key);!Ee.includes(_e.key)&&!sn&&!Ke&&!bn&&!hn&&_e.preventDefault(),te?.(_e)},[Fe,te,$,C,z]);m.useEffect(()=>{if(!K.current){const _e=kt(oe,ye);ie.current=mi(_e,ye),ne(_e)}},[oe,ye]),m.useLayoutEffect(()=>{fe.current&&fe.current.setCustomValidity(W==="error"&&pe?pe:"")},[W,pe]);const je=f?`${Q}-desc`:void 0,Ae=he?`${Q}-err`:void 0,xn=[je,Ae].filter(Boolean).join(" ")||void 0,Le=typeof c=="function"?c(Xe):c??pe,Ye=I===void 0||(oe??0)<I,$n=P===void 0||(oe??0)>P,We=X(Ge.contenedor_base,Ge[`variante_${s}`],Ge[`tam_${l}`],Ge[`radio_${d}`],Ge[`color_${a}`],{[Ge.ancho_total]:u,[Ge.sin_animacion]:_,[Ge.deshabilitado]:y,[Ge.solo_lectura]:w,[Ge.invalido]:he,[Ge.valido]:en,[Ge.enfocado]:ue},A,M?.base);return i.jsxs("div",{className:We,style:T,children:[p&&i.jsxs("label",{className:X(Ge.etiqueta,M?.label),htmlFor:Q,children:[p,v&&i.jsx("span",{className:Ge.marca_requerido,"aria-hidden":"true",children:"*"})]}),i.jsxs("div",{className:X(Ge.envoltorio_input,M?.inputWrapper),children:[i.jsxs("div",{className:X(Ge.envoltorio_interno,M?.innerWrapper),children:[h&&i.jsx("span",{className:Ge.contenido_inicio,children:h}),i.jsx("input",{...ge,ref:fe,id:Q,name:R,type:"text",inputMode:"decimal",value:le,placeholder:r,disabled:y,readOnly:w,required:v,"aria-invalid":he||void 0,"aria-describedby":xn,"aria-required":v,className:X(Ge.entrada,M?.input),onChange:rn,onFocus:ke,onBlur:me,onKeyDown:xe}),g&&i.jsx("span",{className:Ge.contenido_final,children:g})]}),!O&&!w&&!y&&i.jsxs("div",{className:X(Ge.controles,M?.controls),children:[i.jsx("button",{type:"button",tabIndex:-1,className:X(Ge.boton_control,M?.controlButton),disabled:!$n,onClick:()=>Fe(-1),"aria-label":"Decrementar valor",children:i.jsx(hl,{})}),i.jsx("button",{type:"button",tabIndex:-1,className:X(Ge.boton_control,M?.controlButton),disabled:!Ye,onClick:()=>Fe(1),"aria-label":"Incrementar valor",children:i.jsx(pl,{})})]})]}),f&&!he&&i.jsx("div",{id:je,className:X(Ge.descripcion,M?.description),children:f}),he&&Le&&i.jsx("div",{id:Ae,className:X(Ge.mensaje_error,M?.errorMessage),role:"alert",children:Le})]})});vi.displayName="InputNumeric";function ml(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 Ko(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 vl(){return new Date().toISOString().split("T")[0]}function bl(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 Ze={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"},wl=()=>i.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:[i.jsx("circle",{cx:"12",cy:"12",r:"10"}),i.jsx("polyline",{points:"12 6 12 12 16 14"})]}),yl=()=>i.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:[i.jsx("path",{d:"M8 2v4"}),i.jsx("path",{d:"M16 2v4"}),i.jsx("rect",{height:"18",rx:"2",width:"18",x:"3",y:"4"}),i.jsx("path",{d:"M3 10h18"}),i.jsx("circle",{cx:"8",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),i.jsx("circle",{cx:"12",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),i.jsx("circle",{cx:"16",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),i.jsx("circle",{cx:"8",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),i.jsx("circle",{cx:"12",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),i.jsx("circle",{cx:"16",cy:"18",r:"1",fill:"currentColor",stroke:"none"})]}),Cl=()=>i.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:[i.jsx("path",{d:"M18 6 6 18"}),i.jsx("path",{d:"m6 6 12 12"})]}),xl=({tipo:e,onClick:t,onMouseDown:n})=>i.jsx("button",{type:"button",tabIndex:-1,className:Ze.boton_icono,onMouseDown:n,onClick:t,"aria-label":e==="time"?"Abrir selector de hora":"Abrir selector de fecha",children:e==="time"?i.jsx(wl,{}):i.jsx(yl,{})}),bi=m.forwardRef((e,t)=>{const{type:n="date",value:o,defaultValue:r,placeholder:s,variant:a="bordered",color:l="default",size:d="md",radius:u="md",fullWidth:_=!0,disableAnimation:p=!1,label:f,description:c,errorMessage:h,startContent:g,isRequired:v=!1,isReadOnly:w=!1,isDisabled:y=!1,isInvalid:x,validationState:k,validate:L,className:A,classNames:M,style:T,min:P,max:I,isClearable:q=!1,onChange:V,onFocus:S,onBlur:b,id:$,name:D,...N}=e,C=m.useRef(null),O=m.useRef($??`input-date-${Wt(8)}`).current;m.useImperativeHandle(t,()=>C.current);const W=o!==void 0,[G,F]=m.useState(r??""),j=W?o:G,[B,te]=m.useState(!1),Z=m.useRef(!1),R=m.useMemo(()=>{if(j&&n!=="time"&&(P||I)){if(P&&j<P)return`La fecha debe ser ${n==="date"?Ko(P):P} o posterior`;if(I&&j>I)return`La fecha debe ser ${n==="date"?Ko(I):I} o anterior`}if(!L)return null;const H=ml(L(j));return H.invalido?H.mensaje:null},[j,L,P,I,n]),ge=m.useMemo(()=>x!==void 0?x:k==="invalid"?!0:k==="valid"?!1:!!R,[x,k,R]),fe=k==="valid"&&!ge,Ce={invalido:ge,mensaje:R},Q=m.useCallback(H=>{if(y||w)return;Z.current=!1;const K=H.target.value;W||F(K),V?.(K)},[W,y,w,V]),se=m.useCallback(H=>{te(!0),S?.(H)},[S]),re=m.useCallback(H=>{te(!1),Z.current=!1,b?.(H)},[b]),be=m.useCallback(H=>{H.preventDefault()},[]),le=m.useCallback(H=>{if(H.preventDefault(),H.stopPropagation(),!(!C.current||y||w)){if(Z.current){Z.current=!1,C.current.blur();return}C.current.focus();try{C.current.showPicker?.(),Z.current=!0}catch{}}},[y,w]),ne=m.useCallback(H=>{H.preventDefault(),H.stopPropagation(),Z.current=!1,W||F(""),V?.(""),C.current?.focus()},[W,V]),ue=c?`${O}-desc`:void 0,we=ge?`${O}-err`:void 0,oe=[ue,we].filter(Boolean).join(" ")||void 0,ye=typeof h=="function"?h(Ce):h??R,U=X(Ze.contenedor_base,Ze[`variante_${a}`],Ze[`tam_${d}`],Ze[`radio_${u}`],Ze[`color_${l}`],{[Ze.ancho_total]:_,[Ze.sin_animacion]:p,[Ze.deshabilitado]:y,[Ze.solo_lectura]:w,[Ze.invalido]:ge,[Ze.valido]:fe,[Ze.enfocado]:B},A,M?.base);return i.jsxs("div",{className:U,style:T,children:[f&&i.jsxs("label",{className:X(Ze.etiqueta,M?.label),htmlFor:O,children:[f,v&&i.jsx("span",{className:Ze.marca_requerido,"aria-hidden":"true",children:"*"})]}),i.jsx("div",{className:X(Ze.envoltorio_input,M?.inputWrapper),children:i.jsxs("div",{className:X(Ze.envoltorio_interno,M?.innerWrapper),children:[g&&i.jsx("span",{className:Ze.contenido_inicio,children:g}),i.jsx("input",{...N,ref:C,id:O,name:D,type:n,value:W?j:void 0,defaultValue:W?void 0:r,placeholder:s,disabled:y,readOnly:w,required:v,min:P,max:I,"aria-invalid":ge||void 0,"aria-describedby":oe,"aria-required":v,className:X(Ze.entrada,M?.input),onChange:Q,onFocus:se,onBlur:re}),q&&j&&!y&&!w&&i.jsx("button",{type:"button",tabIndex:-1,className:X(Ze.boton_limpiar,M?.clearButton),onMouseDown:H=>H.preventDefault(),onClick:ne,"aria-label":"Limpiar fecha",children:i.jsx(Cl,{})}),i.jsx(xl,{tipo:n,onClick:le,onMouseDown:be})]})}),c&&!ge&&i.jsx("div",{id:ue,className:X(Ze.descripcion,M?.description),children:c}),ge&&ye&&i.jsx("div",{id:we,className:X(Ze.mensaje_error,M?.errorMessage),role:"alert",children:ye})]})});bi.displayName="InputDate";const $l={desvanecerDeslizar:"desvanecer_deslizar",escalar:"escalar"};function Kt({mostrar:e,children:t,tipo:n="desvanecerDeslizar",className:o,...r}){const[s,a]=m.useState(e),[l,d]=m.useState(e?"entrada":null);e&&!s?(a(!0),d("entrada")):!e&&s&&l!=="salida"&&d("salida");const u=()=>{l==="entrada"?d(null):l==="salida"&&(a(!1),d(null))};if(!s)return null;const _=$l[n||"desvanecer"],p=l?`transicion_${_}_${l}`:"";return i.jsx("div",{...r,onAnimationEnd:u,className:`${p} ${o||""}`.trim(),children:t})}const zn={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 Uo(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",...e,children:i.jsxs("g",{fill:"currentColor",children:[i.jsx("path",{d:"M5 3a3 3 0 0 1 6 0v4a3 3 0 0 1-6 0z"}),i.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 Xo(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",...e,children:i.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 wi(e){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 21",...e,children:[i.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"currentColor",opacity:".5"}),i.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 Yo({tipo:e,texto:t,size:n="md",estirar:o}){const r=e==="mic";return i.jsxs("span",{className:X(zn.badge_voz,r?zn.badge_mic:zn.badge_tts,zn[`badge_${n}`],o&&zn.badge_estirada),"data-tipo":e,children:[i.jsx("span",{className:zn.badge_icono,children:r?i.jsx(Uo,{}):i.jsx(Xo,{})}),i.jsx("span",{className:zn.badge_texto,children:t}),r?i.jsxs("span",{className:zn.badge_ondas,"aria-hidden":"true",children:[i.jsx("span",{}),i.jsx("span",{}),i.jsx("span",{})]}):i.jsxs("span",{className:zn.badge_eq,"aria-hidden":"true",children:[i.jsx("span",{}),i.jsx("span",{}),i.jsx("span",{}),i.jsx("span",{})]})]})}function yi({value:e,onChange:t,isDisabled:n,isReadOnly:o,onDictadoCompleto:r,idioma:s="es-ES"}){const[a,l]=m.useState(!1),[d,u]=m.useState(!1),[_,p]=m.useState(null),f=m.useRef(null),c=m.useRef(null),h=m.useRef(null),g=m.useRef(""),v=typeof window<"u"&&"speechSynthesis"in window,w=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),y=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(y(),f.current){try{f.current.stop()}catch(M){console.error("Error stopping recognition:",M)}f.current=null,u(!1)}const A=new SpeechSynthesisUtterance(e);A.lang=s,A.onstart=()=>l(!0),A.onend=()=>{l(!1),c.current=null},A.onerror=()=>{l(!1),c.current=null},c.current=A,window.speechSynthesis.speak(A)},[v,e,s,y]),k=m.useCallback(()=>{if(f.current)try{f.current.stop()}catch(A){console.error("Error stopping recognition:",A)}u(!1),p(null)},[]),L=m.useCallback(()=>{if(!w||n||o)return;y();const A=window,M=A.SpeechRecognition||A.webkitSpeechRecognition;if(!M){p("Navegador no compatible");return}try{const T=new M;T.continuous=!0,T.interimResults=!0,T.lang=s,T.onstart=()=>{u(!0),p(null),g.current=e||""},T.onend=()=>{u(!1),f.current=null,r?.()},T.onerror=P=>{P.error!=="no-speech"&&(u(!1),f.current=null,P.error!=="aborted"&&p("Error al reconocer voz"))},T.onresult=P=>{try{let I="";for(let S=0;S<P.results.length;S++)I+=P.results[S][0].transcript;const q=g.current&&I?" ":"",V=g.current+q+I;t(V)}catch{p("Error procesando dictado")}},f.current=T,T.start()}catch{p("No se pudo iniciar dictado"),u(!1)}},[w,n,o,e,t,s,y,r]);return m.useEffect(()=>()=>{h.current&&clearTimeout(h.current),v&&window.speechSynthesis.cancel(),f.current&&f.current.abort()},[v]),{puedeHablar:v,puedeEscuchar:w,hablando:a,escuchando:d,errorDictado:_,escuchar:x,detenerHablar:y,dictar:L,detenerDictado:k}}function Sl({size:e="1em",className:t}){return i.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:[i.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),i.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}const Te={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"},Ci=m.forwardRef((e,t)=>{const{children:n,variant:o="bordered",color:r="default",size:s="md",radius:a="md",fullWidth:l=!0,disableAnimation:d=!1,label:u,description:_,errorMessage:p,value:f,defaultValue:c,placeholder:h,isRequired:g=!1,isReadOnly:v=!1,isDisabled:w=!1,isClearable:y=!1,isInvalid:x,validationState:k,validate:L,minRows:A=4,maxRows:M=10,disableAutosize:T=!1,hideVoiceActions:P=!1,className:I,classNames:q,style:V,onChange:S,onClear:b,onFocus:$,onBlur:D,id:N,name:C,rows:z,...O}=e,W=m.useRef(null),F=m.useRef(N??`textarea-${Wt(8)}`).current;m.useImperativeHandle(t,()=>W.current);const j=f!==void 0,[B,te]=m.useState(c??""),Z=j?f:B,[R,ge]=m.useState(!1),fe=m.useMemo(()=>{if(!L)return null;const Le=L(Z);return Le===!0||Le==null?null:typeof Le=="string"?Le:typeof Le=="object"&&"message"in Le?Le.message??"Entrada inválida":"Entrada inválida"},[Z,L]),Ce=m.useMemo(()=>x!==void 0?x:k==="invalid"?!0:k==="valid"?!1:!!fe,[x,k,fe]),Q=k==="valid"&&!Ce,se={invalido:Ce,mensaje:fe},re=Z.length>0,be=m.useCallback(()=>{if(!W.current||T)return;const Le=W.current,Ye=window.getComputedStyle(Le),$n=parseFloat(Ye.lineHeight)||parseFloat(Ye.fontSize)*1.5,We=parseFloat(Ye.paddingTop)||0,_e=parseFloat(Ye.paddingBottom)||0,Ee=parseFloat(Ye.borderTopWidth)||0,sn=parseFloat(Ye.borderBottomWidth)||0,Ke=A*$n+We+_e+Ee+sn,bn=M*$n+We+_e+Ee+sn;Le.style.height="auto";const hn=Le.scrollHeight;Le.style.height=`${Math.min(Math.max(hn,Ke),bn)}px`},[T,A,M]);m.useEffect(()=>{T||be()},[Z,be,T]);const le=m.useCallback(Le=>{j||te(Le),S?.(Le)},[j,S]),{puedeHablar:ne,hablando:ue,escuchar:we,detenerHablar:oe,puedeEscuchar:ye,escuchando:U,errorDictado:H,dictar:K,detenerDictado:ie}=yi({isDisabled:w||P,isReadOnly:v,value:Z,onChange:le}),pe=m.useCallback(Le=>{if(w||v)return;const Ye=Le.target.value;j||te(Ye),S?.(Ye)},[j,w,v,S]),he=m.useCallback(Le=>{ge(!0),$?.(Le)},[$]),en=m.useCallback(Le=>{ge(!1),D?.(Le)},[D]),Xe=m.useCallback(()=>{w||v||(j||te(""),S?.(""),b?.(),W.current?.focus())},[j,w,v,S,b]),De=m.useCallback(()=>{ue?oe():we()},[ue,we,oe]),Fe=m.useCallback(()=>{U?ie():K()},[U,K,ie]),rn=_?`${F}-desc`:void 0,ke=Ce||H?`${F}-err`:void 0,me=[rn,ke].filter(Boolean).join(" ")||void 0,xe=typeof p=="function"?p(se):p??fe,je=y&&re&&!v&&!w,Ae=!P||je,xn=X(Te.contenedor_base,Te[`variante_${o}`],Te[`tam_${s}`],Te[`radio_${a}`],Te[`color_${r}`],{[Te.ancho_total]:l,[Te.sin_animacion]:d,[Te.deshabilitado]:w,[Te.solo_lectura]:v,[Te.invalido]:Ce,[Te.valido]:Q,[Te.enfocado]:R},I,q?.base);return i.jsxs("div",{className:xn,style:V,children:[u&&i.jsxs("label",{className:X(Te.etiqueta,q?.label),htmlFor:F,children:[u,g&&i.jsx("span",{className:Te.marca_requerido,"aria-hidden":"true",children:"*"})]}),i.jsxs("div",{className:X(Te.envoltorio_input,q?.inputWrapper),children:[i.jsx("textarea",{...O,ref:W,id:F,name:C,placeholder:h,value:j?Z:void 0,defaultValue:j?void 0:c,onChange:pe,onFocus:he,onBlur:en,className:X(Te.entrada,T&&Te.sin_autosize,q?.input),readOnly:v,disabled:w,rows:z??A,"aria-invalid":Ce||void 0,"aria-describedby":me,"aria-required":g,required:g}),Ae&&i.jsxs("div",{className:X(Te.barra_acciones,q?.actions),children:[i.jsxs("div",{className:Te.badges_contenedor,"aria-live":"polite",role:"status",children:[i.jsx(Kt,{mostrar:U,children:i.jsx(Yo,{tipo:"mic",texto:"Escuchando...",size:s==="lg"?"md":"sm"})}),i.jsx(Kt,{mostrar:ue,children:i.jsx(Yo,{tipo:"tts",texto:"Leyendo...",size:s==="lg"?"md":"sm"})})]}),i.jsxs("div",{className:Te.botones_grupo,children:[!P&&i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:X(Te.boton_accion,ue&&Te.boton_activo_tts),onClick:De,disabled:!ne||!ue&&(!Z||U),title:ue?"Detener lectura":"Leer texto","aria-pressed":ue,"aria-label":ue?"Detener lectura":"Leer texto",children:i.jsx(Xo,{})}),ye&&i.jsx("button",{type:"button",className:X(Te.boton_accion,U&&Te.boton_activo_mic),onClick:Fe,disabled:w||v||ue,title:U?"Detener dictado":"Dictar texto","aria-pressed":U,"aria-label":U?"Detener dictado":"Dictar texto",children:U?i.jsx(wi,{}):i.jsx(Uo,{})})]}),je&&i.jsx("button",{type:"button",className:Te.boton_limpiar,onClick:Xe,title:"Limpiar campo","aria-label":"Limpiar campo",children:i.jsx(Sl,{size:"0.75em"})})]})]})]}),_&&!Ce&&i.jsx("div",{id:rn,className:X(Te.descripcion,q?.description),children:_}),Ce&&xe||H?i.jsxs("div",{id:ke,className:X(Te.mensaje_error,q?.errorMessage),role:"alert",children:[xe,xe&&H&&i.jsx("br",{}),H&&i.jsxs("span",{children:["Error de voz: ",H]})]}):null,n]})});Ci.displayName="TextArea";function Ut(){return typeof window<"u"}function Gn(e){return Zo(e)?(e.nodeName||"").toLowerCase():"#document"}function vn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Mn(e){var t;return(t=(Zo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Zo(e){return Ut()?e instanceof Node||e instanceof vn(e).Node:!1}function Oe(e){return Ut()?e instanceof Element||e instanceof vn(e).Element:!1}function Je(e){return Ut()?e instanceof HTMLElement||e instanceof vn(e).HTMLElement:!1}function Xt(e){return!Ut()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vn(e).ShadowRoot}const kl=new Set(["inline","contents"]);function It(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=wn(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!kl.has(r)}const Il=new Set(["table","td","th"]);function El(e){return Il.has(Gn(e))}const Ml=[":popover-open",":modal"];function Yt(e){return Ml.some(t=>{try{return e.matches(t)}catch{return!1}})}const Nl=["transform","translate","scale","rotate","perspective"],Fl=["transform","translate","scale","rotate","perspective","filter"],Al=["paint","layout","strict","content"];function Jo(e){const t=Zt(),n=Oe(e)?wn(e):e;return Nl.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)||Fl.some(o=>(n.willChange||"").includes(o))||Al.some(o=>(n.contain||"").includes(o))}function Ll(e){let t=Tn(e);for(;Je(t)&&!Pn(t);){if(Jo(t))return t;if(Yt(t))return null;t=Tn(t)}return null}function Zt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Dl=new Set(["html","body","#document"]);function Pn(e){return Dl.has(Gn(e))}function wn(e){return vn(e).getComputedStyle(e)}function Jt(e){return Oe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Tn(e){if(Gn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Xt(e)&&e.host||Mn(e);return Xt(t)?t.host:t}function xi(e){const t=Tn(e);return Pn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Je(t)&&It(t)?t:xi(t)}function Wn(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=xi(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),a=vn(r);if(s){const l=Qo(a);return t.concat(a,a.visualViewport||[],It(r)?r:[],l&&n?Wn(l):[])}return t.concat(r,Wn(r,[],n))}function Qo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Kn=Math.min,yn=Math.max,Qt=Math.round,ft=Math.floor,Nn=e=>({x:e,y:e}),zl={left:"right",right:"left",bottom:"top",top:"bottom"},Pl={start:"end",end:"start"};function Ro(e,t,n){return yn(e,Kn(t,n))}function _t(e,t){return typeof e=="function"?e(t):e}function Un(e){return e.split("-")[0]}function gt(e){return e.split("-")[1]}function $i(e){return e==="x"?"y":"x"}function er(e){return e==="y"?"height":"width"}const Tl=new Set(["top","bottom"]);function On(e){return Tl.has(Un(e))?"y":"x"}function nr(e){return $i(On(e))}function Ol(e,t,n){n===void 0&&(n=!1);const o=gt(e),r=nr(e),s=er(r);let a=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Rt(a)),[a,Rt(a)]}function Vl(e){const t=Rt(e);return[tr(e),t,tr(t)]}function tr(e){return e.replace(/start|end/g,t=>Pl[t])}const Si=["left","right"],ki=["right","left"],ql=["top","bottom"],jl=["bottom","top"];function Bl(e,t,n){switch(e){case"top":case"bottom":return n?t?ki:Si:t?Si:ki;case"left":case"right":return t?ql:jl;default:return[]}}function Hl(e,t,n,o){const r=gt(e);let s=Bl(Un(e),n==="start",o);return r&&(s=s.map(a=>a+"-"+r),t&&(s=s.concat(s.map(tr)))),s}function Rt(e){return e.replace(/left|right|bottom|top/g,t=>zl[t])}function Gl(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ii(e){return typeof e!="number"?Gl(e):{top:e,right:e,bottom:e,left:e}}function eo(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}}/*!
1
+ (function(J,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("react/jsx-runtime"),require("react"),require("firebase/app"),require("firebase/storage"),require("react-dom"),require("xlsx")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","firebase/app","firebase/storage","react-dom","xlsx"],r):(J=typeof globalThis<"u"?globalThis:J||self,r(J.CoreKitUI={},J.jsxRuntime,J.React,J.app,J.storage,J.ReactDOM,J.XLSX))})(this,(function(J,r,h,wa,yt,Fn,Il){"use strict";var or=typeof document<"u"?document.currentScript:null;function rr(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=rr(h),ar=rr(Fn),mn=rr(Il);function ya(e){var n,t,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(n=0;n<a;n++)e[n]&&(t=ya(e[n]))&&(o&&(o+=" "),o+=t)}else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function ne(){for(var e,n,t=0,o="",a=arguments.length;t<a;t++)(e=arguments[t])&&(n=ya(e))&&(o&&(o+=" "),o+=n);return o}const Ca=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,xa=ne,Fl=(e,n)=>t=>{var o;if(n?.variants==null)return xa(e,t?.class,t?.className);const{variants:a,defaultVariants:i}=n,s=Object.keys(a).map(u=>{const _=t?.[u],g=i?.[u];if(_===null)return null;const f=Ca(_)||Ca(g);return a[u][f]}),l=t&&Object.entries(t).reduce((u,_)=>{let[g,f]=_;return f===void 0||(u[g]=f),u},{}),c=n==null||(o=n.compoundVariants)===null||o===void 0?void 0:o.reduce((u,_)=>{let{class:g,className:f,...d}=_;return Object.entries(d).every(m=>{let[p,v]=m;return Array.isArray(v)?v.includes({...i,...l}[p]):{...i,...l}[p]===v})?[...u,g,f]:u},[]);return xa(e,s,c,t?.class,t?.className)},ke={boton:"_boton_9uvrp_1",animated:"_animated_9uvrp_83",disabled:"_disabled_9uvrp_83",loading:"_loading_9uvrp_83",xs:"_xs_9uvrp_117",sm:"_sm_9uvrp_135",md:"_md_9uvrp_153",lg:"_lg_9uvrp_167",full_width:"_full_width_9uvrp_181",icon_only:"_icon_only_9uvrp_189",radius_none:"_radius_none_9uvrp_233",radius_sm:"_radius_sm_9uvrp_241",radius_md:"_radius_md_9uvrp_249",radius_lg:"_radius_lg_9uvrp_257",radius_full:"_radius_full_9uvrp_265",content:"_content_9uvrp_273",spinner:"_spinner_9uvrp_275",start_content:"_start_content_9uvrp_277",end_content:"_end_content_9uvrp_279",content_item:"_content_item_9uvrp_291",only_loading:"_only_loading_9uvrp_323",spinner_icon:"_spinner_icon_9uvrp_343",ripple:"_ripple_9uvrp_379",solid:"_solid_9uvrp_431",bordered:"_bordered_9uvrp_449",ghost:"_ghost_9uvrp_469",light:"_light_9uvrp_493",light_active:"_light_active_9uvrp_511",faded:"_faded_9uvrp_531",shadow:"_shadow_9uvrp_551",outline:"_outline_9uvrp_625",muted:"_muted_9uvrp_649",contrast:"_contrast_9uvrp_667",tap_animating:"_tap_animating_9uvrp_713",default:"_default_9uvrp_731",primary:"_primary_9uvrp_741",secondary:"_secondary_9uvrp_751",success:"_success_9uvrp_761",warning:"_warning_9uvrp_771",danger:"_danger_9uvrp_781"},zl=Fl(ke.boton,{variants:{variant:{solid:ke.solid,bordered:ke.bordered,ghost:ke.ghost,light:ke.light,"light-active":ke.light_active,faded:ke.faded,shadow:ke.shadow,outline:ke.outline,muted:ke.muted,contrast:ke.contrast},color:{default:ke.default,primary:ke.primary,secondary:ke.secondary,success:ke.success,warning:ke.warning,danger:ke.danger},size:{xs:ke.xs,sm:ke.sm,md:ke.md,lg:ke.lg},radius:{none:ke.radius_none,sm:ke.radius_sm,md:ke.radius_md,lg:ke.radius_lg,full:ke.radius_full},fullWidth:{true:ke.full_width},isIconOnly:{true:ke.icon_only},isLoading:{true:ke.loading},onlyLoading:{true:ke.only_loading},isDisabled:{true:ke.disabled},disableAnimation:{true:ke.animated}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"lg",disableAnimation:!0}}),Ze=h.forwardRef(({variant:e="solid",color:n="default",size:t="md",radius:o="lg",fullWidth:a=!1,isLoading:i=!1,onlyLoading:s=!1,isDisabled:l=!1,isIconOnly:c=!1,disableRipple:u=!1,disableAnimation:_=!0,animationTap:g=!1,customColor:f,startContent:d,endContent:m,spinner:p,spinnerPlacement:v="end",permisos:y,permiso:w,children:C,className:k,onClick:z,style:A,type:N="button","aria-label":P,...O},E)=>{const T=w&&y?!y.includes(w):!1,V=l||i||T,S=h.useRef(null),b=D=>{if(V){D.preventDefault();return}if(z?.(D),g&&!V&&D.currentTarget instanceof HTMLElement){const j=D.currentTarget;S.current&&(clearTimeout(S.current),S.current=null),j.classList.remove(ke.tap_animating),j.offsetWidth,j.classList.add(ke.tap_animating),S.current=setTimeout(()=>{j.classList.remove(ke.tap_animating),S.current=null},230)}if(u||V||!(D.currentTarget instanceof HTMLElement))return;const B=D.currentTarget,X=document.createElement("span"),U=B.getBoundingClientRect(),L=Math.max(U.width,U.height);X.className=ke.ripple,X.style.width=`${L}px`,X.style.height=`${L}px`,X.style.left=`${D.clientX-U.left}px`,X.style.top=`${D.clientY-U.top}px`,X.addEventListener("animationend",()=>X.remove(),{once:!0}),B.appendChild(X)},x=f?{"--btn-color":f,"--btn-text-color":f,...A}:A,F=zl({variant:e,color:f?void 0:n,size:t,radius:o,fullWidth:a,isIconOnly:c,isLoading:i,onlyLoading:s,isDisabled:V,disableAnimation:_}),I=i&&r.jsx("span",{className:ke.spinner,"aria-hidden":s?void 0:"true",children:p||r.jsx("span",{className:ke.spinner_icon})}),$=s&&!P?"Cargando":P;return r.jsxs("button",{...O,ref:E,type:N,"aria-label":$,"aria-busy":i,className:ne(F,k),disabled:V,onClick:b,style:x,children:[v==="start"&&I,d&&!s&&r.jsx("span",{className:ne(ke.start_content,ke.content_item),children:d}),C&&!s&&r.jsx("span",{className:ke.content,children:C}),m&&!s&&r.jsx("span",{className:ne(ke.end_content,ke.content_item),children:m}),v==="end"&&I]})});Ze.displayName="Boton";const Ft={badge:"_badge_1ojub_1",badge_clickable:"_badge_clickable_1ojub_41",size_xs:"_size_xs_1ojub_65",size_sm:"_size_sm_1ojub_77",size_md:"_size_md_1ojub_89",size_lg:"_size_lg_1ojub_101",size_xl:"_size_xl_1ojub_113",radius_none:"_radius_none_1ojub_125",radius_sm:"_radius_sm_1ojub_133",radius_md:"_radius_md_1ojub_141",radius_lg:"_radius_lg_1ojub_149",radius_full:"_radius_full_1ojub_157",dot:"_dot_1ojub_165",icon:"_icon_1ojub_179",dismiss_button:"_dismiss_button_1ojub_191",variant_solid:"_variant_solid_1ojub_251",color_default:"_color_default_1ojub_259",color_primary:"_color_primary_1ojub_269",color_secondary:"_color_secondary_1ojub_279",color_success:"_color_success_1ojub_289",color_warning:"_color_warning_1ojub_299",color_danger:"_color_danger_1ojub_309",color_info:"_color_info_1ojub_319",color_brand:"_color_brand_1ojub_329",variant_subtle:"_variant_subtle_1ojub_339",variant_outline:"_variant_outline_1ojub_419",variant_soft:"_variant_soft_1ojub_515",badge_custom:"_badge_custom_1ojub_595"},Ll=()=>r.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:r.jsx("path",{d:"M2 2L8 8M8 2L2 8"})}),$a=({variant:e="solid",color:n="default",size:t="md",radius:o="md",children:a,startIcon:i,endIcon:s,dot:l,dismissible:c,onDismiss:u,customColor:_,className:g="",onClick:f})=>{const d=!!f,m=h.useMemo(()=>{if(!_)return;const y=_,w=`color-mix(in oklab, ${y} 15%, transparent)`;return{solid:{"--badge-custom-bg":y,"--badge-custom-text":"white","--badge-custom-border":"transparent"},subtle:{"--badge-custom-bg":w,"--badge-custom-text":y,"--badge-custom-border":"transparent"},outline:{"--badge-custom-bg":"transparent","--badge-custom-text":y,"--badge-custom-border":y},soft:{"--badge-custom-bg":`color-mix(in oklab, ${y} 10%, var(--surface-first))`,"--badge-custom-text":y,"--badge-custom-border":"transparent"}}[e]},[_,e]),p=[Ft.badge,Ft[`size_${t}`],Ft[`radius_${o}`],Ft[`variant_${e}`],!_&&Ft[`color_${n}`],_&&Ft.badge_custom,d&&Ft.badge_clickable,g].filter(Boolean).join(" "),v=h.useMemo(()=>_||{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,_]);return r.jsxs("span",{className:p,style:m,onClick:f,role:d?"button":void 0,tabIndex:d?0:void 0,children:[l&&r.jsx("span",{className:Ft.dot,style:{backgroundColor:v}}),i&&r.jsx("span",{className:Ft.icon,children:i}),a,s&&r.jsx("span",{className:Ft.icon,children:s}),c&&r.jsx("button",{type:"button",className:Ft.dismiss_button,onClick:y=>{y.stopPropagation(),u?.()},"aria-label":"Eliminar badge",children:r.jsx(Ll,{})})]})},Ue={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"},ir=h.forwardRef(({isSelected:e,defaultSelected:n=!1,onChange:t,label:o,description:a,size:i="md",color:s="primary",customColor:l,variant:c="default",isDisabled:u=!1,isReadOnly:_=!1,isInvalid:g=!1,isRequired:f=!1,showIcons:d=!1,labelPlacement:m="right",labelPosition:p="inline",justifyEnd:v=!1,children:y,className:w="",...C},k)=>{const[z,A]=h.useState(n),N=h.useId(),P=C.id||N,O=e!==void 0?e:z,E=I=>{if(u||_)return;const $=I.target.checked;e===void 0&&A($),t&&t($)},T=y||o,V=[Ue.contenedor_toggle,Ue[`tam_${i}`],!l&&Ue[`color_${s}`],Ue[`variante_${c}`],Ue[`label_${m}`],Ue[`posicion_${p}`],O&&Ue.seleccionado,u&&Ue.deshabilitado,_&&Ue.solo_lectura,g&&Ue.invalido,d&&Ue.con_iconos,v&&Ue.justify_end,w].filter(Boolean).join(" "),S=l?{"--toggle-custom-color":l}:void 0,b=()=>T?r.jsxs("div",{className:Ue.contenedor_label,children:[r.jsxs("span",{className:Ue.texto_label,children:[T,f&&r.jsx("span",{className:Ue.marca_requerido,children:" *"})]}),a&&r.jsx("span",{className:Ue.texto_descripcion,children:a})]}):null,x=()=>c!=="moon"?null:r.jsx("div",{className:Ue.icono_moon,children:r.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",children:r.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"})})}),F=()=>!d||c==="moon"?null:r.jsxs(r.Fragment,{children:[r.jsx("svg",{className:Ue.icono_check,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("polyline",{points:"2,6 5,9 10,3"})}),r.jsxs("svg",{className:Ue.icono_x,width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[r.jsx("line",{x1:"2",y1:"2",x2:"8",y2:"8"}),r.jsx("line",{x1:"8",y1:"2",x2:"2",y2:"8"})]})]});return r.jsxs("div",{className:V,style:S,children:[p==="top"&&b(),r.jsxs("label",{className:Ue.envoltorio_toggle,htmlFor:P,children:[p==="inline"&&m==="left"&&b(),r.jsxs("div",{className:Ue.pista_toggle,children:[r.jsx("input",{ref:k,type:"checkbox",id:P,checked:O,disabled:u,readOnly:_,required:f,"aria-invalid":g,className:Ue.input,onChange:E,...C}),r.jsx("div",{className:Ue.fondo_pista,children:r.jsxs("div",{className:Ue.pulgar_toggle,children:[x(),F()]})})]}),p==="inline"&&m==="right"&&b()]})]})});ir.displayName="Toggle";const Al=({className:e})=>r.jsx("svg",{className:e,width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),Sa=({className:e})=>r.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.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"})}),Dl=({className:e})=>r.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"M3 7v6h6M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})}),Pl=({className:e})=>r.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"})}),Tl=({className:e})=>r.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"M12 20h9M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})}),Ol=({className:e})=>r.jsxs("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"}),r.jsx("path",{d:"M15 19h6"}),r.jsx("path",{d:"M18 16v6"})]}),Vl=({className:e})=>r.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"M20 6L9 17l-5-5"})}),ve={backdrop:"_backdrop_3rgw3_1",visible:"_visible_3rgw3_41",modal:"_modal_3rgw3_65",cuerpo_modal:"_cuerpo_modal_3rgw3_107",encabezado:"_encabezado_3rgw3_155",titulo:"_titulo_3rgw3_169",boton_cerrar:"_boton_cerrar_3rgw3_183",texto_esc:"_texto_esc_3rgw3_223",icono_x:"_icono_x_3rgw3_237",contenedor_lienzo:"_contenedor_lienzo_3rgw3_247",area_firma:"_area_firma_3rgw3_257",superficie_lienzo:"_superficie_lienzo_3rgw3_271",lienzo:"_lienzo_3rgw3_279",lienzo_deshabilitado:"_lienzo_deshabilitado_3rgw3_309",barra_acciones:"_barra_acciones_3rgw3_319",grupo_izquierda:"_grupo_izquierda_3rgw3_339",grupo_derecha:"_grupo_derecha_3rgw3_351",separador:"_separador_3rgw3_363",boton_accion:"_boton_accion_3rgw3_375",contenedor_guardar:"_contenedor_guardar_3rgw3_435",boton_texto_con_icono:"_boton_texto_con_icono_3rgw3_447",accion_texto:"_accion_texto_3rgw3_459",icono_boton_accion:"_icono_boton_accion_3rgw3_469",icono:"_icono_3rgw3_237",contenedor_consentimiento:"_contenedor_consentimiento_3rgw3_495",texto_consentimiento:"_texto_consentimiento_3rgw3_509",consentimiento_fila:"_consentimiento_fila_3rgw3_525",toggle_consentimiento:"_toggle_consentimiento_3rgw3_539",contenedor_subir_oculto:"_contenedor_subir_oculto_3rgw3_547",boton_adjuntar:"_boton_adjuntar_3rgw3_559",input_archivo:"_input_archivo_3rgw3_599",input_validacion_firma:"_input_validacion_firma_3rgw3_607",bloque_firma:"_bloque_firma_3rgw3_635",bloque_encabezado:"_bloque_encabezado_3rgw3_657",bloque_titulo:"_bloque_titulo_3rgw3_669",marca_requerido:"_marca_requerido_3rgw3_685",bloque_preview:"_bloque_preview_3rgw3_695",bloque_preview_imagen:"_bloque_preview_imagen_3rgw3_723",bloque_preview_placeholder:"_bloque_preview_placeholder_3rgw3_737",bloque_acciones:"_bloque_acciones_3rgw3_751",accion_agregar_firma:"_accion_agregar_firma_3rgw3_765",accion_eliminar_firma:"_accion_eliminar_firma_3rgw3_767"},Bl=8,jl=1.2,rn=4.2,ql=1.8,ka=(e,n,t)=>Math.max(n,Math.min(t,e)),Hl=(e,n)=>{const t=n.x-e.x,o=n.y-e.y;return Math.sqrt(t*t+o*o)},Na=e=>Number.isFinite(e)?e:performance.now(),Wl=()=>{const e=h.useRef(null),[n,t]=h.useState(!0),[o,a]=h.useState(!1),[i,s]=h.useState([]),l=h.useRef([]),c=h.useRef({color:"#111827",enabled:!0}),u=h.useRef(null),_=h.useRef([]),g=h.useRef(0),f=h.useRef(rn),d=h.useRef(!1),m=h.useCallback(()=>e.current?.getContext("2d")??null,[]),p=h.useCallback(()=>m(),[m]),v=h.useCallback(()=>{const S=e.current,b=m();S&&b&&b.clearRect(0,0,S.width,S.height),t(!0),l.current=[],s([]),_.current=[],u.current=null,f.current=rn,d.current=!1},[m]),y=h.useCallback(()=>{d.current=!0,t(!1)},[]),w=h.useCallback((S,b)=>{const x=Math.max(1,b.t-S.t),I=Hl(S,b)/x,D=(rn-I*ql)*ka(b.pressure||.5,.35,1),B=ka(D,jl,rn),U=f.current+(B-f.current)*.25;return f.current=U,U},[]),C=h.useCallback((S,b)=>{S.strokeStyle=c.current.color,S.lineWidth=b,S.lineCap="round",S.lineJoin="round"},[]),k=h.useCallback((S,b)=>{const x=p();if(!x)return;const F=w(S,b);C(x,F),x.beginPath(),x.moveTo(S.x,S.y),x.quadraticCurveTo(S.x,S.y,b.x,b.y),x.stroke(),t(!1)},[w,p,C]),z=h.useCallback(S=>{const b=e.current;if(!b)return{pressure:.5,t:performance.now(),x:0,y:0};const x=b.getBoundingClientRect(),F=b.width/x.width,I=b.height/x.height;return{pressure:S.pressure&&S.pressure>0?S.pressure:.5,t:S.timeStamp||performance.now(),x:(S.clientX-x.left)*F,y:(S.clientY-x.top)*I}},[]),A=h.useCallback(S=>{if(!c.current.enabled)return;S.preventDefault();const b=e.current;if(!b)return;b.setPointerCapture(S.pointerId);const x=z(S);a(!0),u.current=x,_.current=[x],g.current=Na(S.timeStamp)},[z]),N=h.useCallback(S=>{if(!o||!c.current.enabled)return;S.preventDefault();const b=Na(S.timeStamp);if(b-g.current<Bl)return;g.current=b;const x=z(S),F=u.current;F&&(k(F,x),u.current=x,_.current.push(x))},[k,o,z]),P=h.useCallback(S=>{if(S&&e.current?.hasPointerCapture(S.pointerId)&&e.current.releasePointerCapture(S.pointerId),o&&_.current.length>0){const b=[...l.current,{puntos:[..._.current]}];l.current=b,s(b)}a(!1),u.current=null,_.current=[]},[o]),O=h.useCallback((S,b,x)=>{if(!(b.puntos.length<2))for(let F=1;F<b.puntos.length;F++){const I=b.puntos[F-1],$=b.puntos[F],D=w(I,$);S.strokeStyle=x??c.current.color,S.lineWidth=D,S.lineCap="round",S.lineJoin="round",S.beginPath(),S.moveTo(I.x,I.y),S.quadraticCurveTo(I.x,I.y,$.x,$.y),S.stroke()}},[w]),E=h.useCallback(()=>{if(l.current.length===0)return;const S=l.current.slice(0,-1);l.current=S,s(S);const b=e.current;if(!b)return;const x=m();x&&(x.clearRect(0,0,b.width,b.height),f.current=rn,S.forEach(F=>O(x,F)),t(S.length===0&&!d.current))},[m,O]),T=h.useCallback((S={})=>{const b=e.current;if(!b||n&&l.current.length===0&&!d.current)return null;const{backgroundColor:x,format:F,quality:I,strokeColor:$}=S;if(!x&&!$)return b.toDataURL("image/png");const D=document.createElement("canvas");D.width=b.width,D.height=b.height;const B=D.getContext("2d");if(!B)return null;x&&(B.fillStyle=x,B.fillRect(0,0,D.width,D.height)),$&&l.current.length>0&&!d.current?(f.current=rn,l.current.forEach(L=>O(B,L,$))):B.drawImage(b,0,0);const X=F??"image/png",U=I??.85;return X==="image/png"?D.toDataURL(X):D.toDataURL(X,U)},[n,O]),V=h.useCallback(S=>{const b=e.current,x=m();if(!b||!x)return;if(c.current={color:S.color,enabled:S.enabled??!0},b.style.touchAction="none",b.style.userSelect="none",!c.current.enabled)return()=>{};const F=B=>A(B),I=B=>N(B),$=B=>P(B),D=B=>P(B);return b.addEventListener("pointerdown",F,{passive:!1}),b.addEventListener("pointermove",I,{passive:!1}),b.addEventListener("pointerup",$,{passive:!1}),b.addEventListener("pointerleave",$,{passive:!1}),b.addEventListener("pointercancel",D,{passive:!1}),()=>{b.removeEventListener("pointerdown",F),b.removeEventListener("pointermove",I),b.removeEventListener("pointerup",$),b.removeEventListener("pointerleave",$),b.removeEventListener("pointercancel",D)}},[P,A,N,m]);return h.useEffect(()=>{f.current=rn},[i.length]),{canvasRef:e,configurarCanvas:V,deshacerUltimoTrazo:E,estaVacio:n,limpiarCanvas:v,marcarConContenido:y,obtenerDatosFirma:T,puedeDeshacer:i.length>0}},Ea=h.forwardRef(({alto:e=200,ancho:n=700,aspectRatio:t,className:o,closeOnBackdropClick:a=!1,firmaInicial:i=null,isOpen:s=!1,isRequired:l=!1,mostrarBotonSubir:c=!0,name:u,onClose:_,onConfirm:g,readonly:f=!1,readonlyPostGuardado:d=!1,requiredMessage:m="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:y="Deshacer",textoEliminarFirma:w="Eliminar firma",textoEstadoGuardada:C="Guardada",textoEstadoPendiente:k="Pendiente",textoGuardar:z="Guardar firma",textoLimpiar:A="Limpiar",textoModificar:N="Modificar firma",textoReemplazarFirma:P="Reemplazar firma",textoSolicitarFirma:O="Agregar firma",tituloBloque:E="Firma del responsable",titulo:T="Firmar el contrato",mostrarBotonAgregarFirma:V=!0,mostrarBotonEliminarFirma:S=!0,firebasePath:b,firebaseStorage:x,onFirebaseUploadSuccess:F,onFirebaseUploadError:I,fondoTransparente:$=!0},D)=>{const{canvasRef:B,configurarCanvas:X,deshacerUltimoTrazo:U,estaVacio:L,limpiarCanvas:j,marcarConContenido:W,obtenerDatosFirma:ie,puedeDeshacer:re}=Wl(),ae=h.useRef(null),me=h.useRef(null),ee=h.useRef(null),fe=h.useId(),R=`${fe}-toggle`,se=`${fe}-texto`,_e=`${fe}-dialog-title`,Se=`${fe}-dialog-description`,[ge,le]=h.useState(!!s),[he,G]=h.useState(!1),[Y,ce]=h.useState(i),[K,q]=h.useState(n),[H,de]=h.useState(!1),[te,pe]=h.useState(!!i),[Ye,Oe]=h.useState(!1),[Ae,Ne]=h.useState(!1),ot=Math.round(K*e/Math.max(1,n)),Me=f||d&&te,bt=!f&&!(d&&te),Te=h.useCallback(Ie=>{const Fe=B.current,Je=Fe?.getContext("2d");if(!Fe||!Je)return;const kt=new Image;kt.onload=()=>{Je.clearRect(0,0,Fe.width,Fe.height);const Mt=Fe.width/Fe.height,hn=kt.width/kt.height;let eo=Fe.width,to=Fe.height,Ro=0,er=0;hn>Mt?(to=Fe.width/hn,er=(Fe.height-to)/2):(eo=Fe.height*hn,Ro=(Fe.width-eo)/2),Je.drawImage(kt,Ro,er,eo,to),W(),Oe(!0)},kt.src=Ie},[B,W]),be=h.useCallback(()=>{if(x&&typeof x=="object")return x;if(!wa.getApps().length)throw new Error("Firebase no esta inicializado. Inicializa la app y el almacenamiento antes de usar firebasePath o pasa firebaseStorage al componente.");return yt.getStorage()},[x]),Ge=h.useCallback(()=>{j(),ce(null),Oe(!1),pe(!1)},[j]),lt=h.useCallback(()=>{Me||(j(),Oe(!1))},[Me,j]),Ee=h.useCallback(async()=>{if(Me||Ae)return;const Ie=be(),Fe=typeof Y=="string"&&/^https?:\/\//i.test(Y)?yt.ref(Ie,Y):b?yt.ref(Ie,b):null;try{Fe&&(Ne(!0),await yt.deleteObject(Fe)),Ge(),g?.("")}catch(Je){if(typeof Je=="object"&&Je!==null&&"code"in Je&&String(Je.code)==="storage/object-not-found"){Ge(),g?.("");return}console.error("Error al eliminar la firma de Firebase:",Je),I?.(Je instanceof Error?Je:new Error(String(Je)))}finally{Fe&&Ne(!1)}},[Me,Y,b,be,Ge,g,I,Ae]),rt=h.useCallback(()=>{f||(j(),pe(!1),Oe(!1),de(!1))},[j,f]),St=h.useCallback(Ie=>{if(Me)return;const Fe=Ie.target.files?.[0];if(!Fe)return;const Je=new FileReader;Je.onload=kt=>{const Mt=kt.target?.result;typeof Mt=="string"&&(j(),Te(Mt))},Je.readAsDataURL(Fe)},[Me,Te,j]),Et=h.useCallback(()=>{Me||ae.current?.click()},[Me]),Ce=h.useCallback(()=>{de(!1),Oe(!1),j()},[j]),xe=h.useCallback(Ie=>{he||(G(!0),setTimeout(()=>{le(!1),G(!1),Ie?.()},400))},[he]),et=h.useCallback(()=>{xe(()=>{Ce(),_?.()})},[xe,Ce,_]),Be=h.useCallback(async()=>{if(Me||he||Ae)return;const Ie=ie($?{format:"image/png",strokeColor:"#111827"}:{backgroundColor:"#ffffff",format:"image/jpeg",quality:.82,strokeColor:"#111827"});if(!Ie||!H)return;let Fe=Ie;try{if(b){Ne(!0);const Je=be();let kt;try{kt=yt.ref(Je,b)}catch(Mt){const hn=Mt instanceof Error?Mt.message:String(Mt);throw new Error(`No se pudo crear la referencia de Firebase Storage para "${b}". Posible conflicto por dos copias de Firebase (la app y la libreria). Verifica que firebase este externalizado en corekit-ui y que la app use una sola instancia del SDK. Detalle: ${hn}`)}await yt.uploadString(kt,Ie,"data_url"),Fe=await yt.getDownloadURL(kt),F?.(Fe)}xe(()=>{ce(Fe),pe(!0),g?.(Fe),Ce(),_?.()})}catch(Je){console.error("Error al subir la firma a Firebase:",Je),I?.(Je instanceof Error?Je:new Error(String(Je)))}finally{b&&Ne(!1)}},[Me,he,Ae,ie,$,H,b,xe,be,F,g,Ce,_,I]);h.useEffect(()=>{s&&(le(!0),G(!1))},[s]),h.useEffect(()=>{ce(i),pe(!!i)},[i]),h.useEffect(()=>{if(!ge)return;const Ie=()=>{const Fe=ee.current;Fe&&q(Math.max(1,Math.floor(Fe.clientWidth)))};return Ie(),window.addEventListener("resize",Ie),()=>window.removeEventListener("resize",Ie)},[n,ge]),h.useImperativeHandle(D,()=>({limpiar:j,obtenerDatosFirma:ie,estaVacio:()=>L}),[L,j,ie]),h.useEffect(()=>{if(!ge)return;const Ie=X({color:"#111827",enabled:!Me});return()=>{Ie?.()}},[Me,X,ge]),h.useEffect(()=>{if(!ge){document.body.style.overflow="";return}const Ie=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",Ie>0&&(document.body.style.paddingRight=`${Ie}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[ge]),h.useEffect(()=>{ge||Ce()},[Ce,ge]),h.useEffect(()=>{if(!ge)return;const Ie=Fe=>{if(Fe.key==="Escape"){et();return}if(Fe.ctrlKey&&Fe.key.toLowerCase()==="z"){Fe.preventDefault(),!Me&&re&&U();return}Fe.ctrlKey&&Fe.key==="Enter"&&(Fe.preventDefault(),Me||Be())};return document.addEventListener("keydown",Ie),()=>document.removeEventListener("keydown",Ie)},[Me,U,et,Be,ge,re]),h.useEffect(()=>{const Ie=me.current;if(!Ie)return;if(l&&!!!Y){Ie.setCustomValidity(m);return}Ie.setCustomValidity("")},[Y,l,m]);const wt=h.useCallback(Ie=>{he||!a||Ie.target===Ie.currentTarget&&et()},[a,he,et]),Tt=Me,ba=Me||Ye,Ot=Me||!te&&(L&&!Ye||!H),Qo=()=>{f||(Y&&rt(),G(!1),le(!0))};return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${ve.bloque_firma} ${o||""}`,children:[r.jsxs("div",{className:ve.bloque_encabezado,children:[r.jsxs("span",{className:ve.bloque_titulo,children:[E,l&&r.jsx("span",{className:ve.marca_requerido,"aria-hidden":"true",children:"*"})]}),r.jsx($a,{color:Y?"success":"warning",size:"sm",variant:"outline",children:Y?C:k})]}),r.jsxs("div",{className:ve.bloque_preview,style:t?{aspectRatio:t}:void 0,children:[(l||u)&&r.jsx("input",{ref:me,className:ve.input_validacion_firma,"aria-hidden":"true",name:u,required:l,tabIndex:-1,type:"text",value:Y?"signed":"",onChange:()=>{},onInvalid:Ie=>{l&&!Y&&Ie.currentTarget.setCustomValidity(m)},onInput:Ie=>{Ie.currentTarget.setCustomValidity("")}}),Y?r.jsx("img",{src:Y,alt:"Firma guardada",className:ve.bloque_preview_imagen}):r.jsx("span",{className:ve.bloque_preview_placeholder,children:"Sin firma registrada"})]}),!f&&(V||S&&!!Y)&&r.jsxs("div",{className:ve.bloque_acciones,children:[V&&r.jsx(Ze,{color:"primary",size:"sm",variant:"solid",onClick:Qo,className:ve.accion_agregar_firma,isDisabled:Me||he,children:r.jsxs("span",{className:ve.boton_texto_con_icono,children:[Y?r.jsx(Tl,{className:ve.icono_boton_accion}):r.jsx(Ol,{className:ve.icono_boton_accion}),r.jsx("span",{className:ve.accion_texto,children:Y?P:O})]})}),S&&Y&&r.jsx(Ze,{color:"danger",size:"sm",variant:"bordered",onClick:Ee,className:ve.accion_eliminar_firma,isDisabled:Me||he||Ae,children:r.jsxs("span",{className:ve.boton_texto_con_icono,children:[r.jsx(Sa,{className:ve.icono_boton_accion}),r.jsx("span",{className:ve.accion_texto,children:w})]})})]})]}),ge&&r.jsx("div",{className:`${ve.backdrop} ${he?"":ve.visible}`,onClick:wt,children:r.jsxs("div",{className:`${ve.modal} ${he?"":ve.visible}`,role:"dialog","aria-modal":"true","aria-labelledby":_e,"aria-describedby":Se,children:[r.jsxs("header",{className:ve.encabezado,children:[r.jsx("h2",{id:_e,className:ve.titulo,children:T}),r.jsxs("button",{className:ve.boton_cerrar,onClick:et,type:"button","aria-label":"Cerrar",children:[r.jsx("span",{className:ve.texto_esc,children:"ESC"}),r.jsx(Al,{className:ve.icono_x})]})]}),r.jsxs("div",{className:ve.cuerpo_modal,children:[r.jsx("div",{className:ve.contenedor_lienzo,ref:ee,children:r.jsxs("div",{className:ve.area_firma,children:[r.jsx("div",{className:ve.superficie_lienzo,children:r.jsx("canvas",{ref:B,className:`${ve.lienzo} ${Tt?ve.lienzo_deshabilitado:""}`,width:K,height:ot,style:{height:`${ot}px`,pointerEvents:ba?"none":"auto",width:"100%"},"aria-label":"Area de firma"})}),bt&&r.jsxs("div",{className:ve.barra_acciones,role:"toolbar","aria-label":"Herramientas de firma",children:[r.jsxs("div",{className:ve.grupo_izquierda,children:[r.jsxs("button",{className:ve.boton_accion,onClick:U,type:"button",disabled:!re||Tt,"aria-label":y,children:[r.jsx(Dl,{className:ve.icono,"aria-hidden":"true"}),r.jsx("span",{children:y})]}),r.jsx("span",{className:ve.separador,"aria-hidden":"true",children:"|"}),r.jsxs("button",{className:ve.boton_accion,onClick:lt,type:"button",disabled:L&&!Ye||Tt,"aria-label":A,children:[r.jsx(Sa,{className:ve.icono,"aria-hidden":"true"}),r.jsx("span",{children:A})]})]}),c&&r.jsx("div",{className:ve.grupo_derecha,children:r.jsxs("button",{className:ve.boton_adjuntar,onClick:Et,type:"button",disabled:Me,children:[r.jsx(Pl,{className:ve.icono,"aria-hidden":"true"}),p]})})]})]})}),bt&&r.jsxs(r.Fragment,{children:[r.jsx("div",{id:Se,className:ve.contenedor_consentimiento,children:r.jsxs("div",{className:ve.consentimiento_fila,children:[r.jsx(ir,{id:R,isSelected:H,onChange:de,color:"primary",size:"md",isDisabled:Me,"aria-describedby":se,className:ve.toggle_consentimiento}),r.jsx("label",{htmlFor:R,id:se,className:ve.texto_consentimiento,children:v})]})}),r.jsx("div",{className:ve.contenedor_guardar,children:r.jsx(Ze,{color:"primary",variant:"solid",size:"md",onClick:te&&!d?rt:Be,type:"button",isLoading:Ae,isDisabled:Ot||Ae,startContent:Ae?void 0:r.jsx(Vl,{className:ve.icono,"aria-hidden":"true"}),children:Ae?"Guardando...":te&&!d?N:z})})]}),bt&&c&&r.jsx("div",{className:ve.contenedor_subir_oculto,children:r.jsx("input",{ref:ae,type:"file",accept:"image/*",className:ve.input_archivo,onChange:St,"aria-label":"Subir imagen de firma"})})]})]})})]})});Ea.displayName="Signature";const Gl="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let no=(e=21)=>{let n="",t=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)n+=Gl[t[e]&63];return n};const Zl=({size:e="1em",...n})=>r.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:[r.jsx("path",{d:"M18 6 6 18"}),r.jsx("path",{d:"m6 6 12 12"})]}),Ul=({size:e="1em",...n})=>r.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:[r.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"}),r.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),Kl=({size:e="1em",...n})=>r.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:[r.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"}),r.jsx("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),r.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"}),r.jsx("path",{d:"m2 2 20 20"})]}),Ke={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"},Ma=h.forwardRef((e,n)=>{const{type:t="text",value:o,defaultValue:a,placeholder:i,variant:s="bordered",color:l="default",size:c="md",radius:u="md",fullWidth:_=!0,disableAnimation:g=!1,label:f,description:d,errorMessage:m,startContent:p,endContent:v,isRequired:y=!1,isReadOnly:w=!1,isDisabled:C=!1,isClearable:k=!1,isInvalid:z,validationState:A,validate:N,className:P,classNames:O,style:E,onChange:T,onClear:V,onValueChange:S,onFocus:b,onBlur:x,onKeyDown:F,id:I,name:$,autoComplete:D,autoFocus:B,maxLength:X,minLength:U,pattern:L,...j}=e,W=h.useRef(null),re=h.useRef(I??`input-text-${no(8)}`).current;h.useImperativeHandle(n,()=>W.current);const ae=o!==void 0,[me,ee]=h.useState(a??""),fe=ae?o:me,[R,se]=h.useState(!1),[_e,Se]=h.useState(!1),ge=h.useMemo(()=>{if(!N)return null;const Te=N(fe);return Te===!0||Te==null?null:typeof Te=="string"?Te:typeof Te=="object"&&"message"in Te?Te.message??"Entrada inválida":"Entrada inválida"},[fe,N]),le=h.useMemo(()=>z!==void 0?z:A==="invalid"?!0:A==="valid"?!1:!!ge,[z,A,ge]),he=A==="valid"&&!le,G={invalido:le,mensaje:ge},Y=fe.length>0,ce=t==="password",K=ce&&_e?"text":t,q=k&&Y&&!w&&!C,H=h.useCallback(Te=>{if(C||w)return;const be=Te.target.value;ae||ee(be),T?.(be),S?.(be)},[ae,C,w,T,S]),de=h.useCallback(Te=>{se(!0),b?.(Te)},[b]),te=h.useCallback(Te=>{se(!1),x?.(Te)},[x]),pe=h.useCallback(()=>{C||w||(ae||ee(""),T?.(""),S?.(""),V?.(),W.current?.focus())},[ae,C,w,T,S,V]),Ye=h.useCallback(Te=>{Te.key==="Escape"&&k&&Y&&pe(),F?.(Te)},[k,Y,pe,F]),Oe=h.useCallback(()=>{Se(Te=>!Te),requestAnimationFrame(()=>W.current?.focus())},[]),Ae=d?`${re}-desc`:void 0,Ne=le?`${re}-err`:void 0,ot=[Ae,Ne].filter(Boolean).join(" ")||void 0,Me=typeof m=="function"?m(G):m??ge,bt=ne(Ke.contenedor_base,Ke[`variante_${s}`],Ke[`tam_${c}`],Ke[`radio_${u}`],Ke[`color_${l}`],{[Ke.ancho_total]:_,[Ke.sin_animacion]:g,[Ke.deshabilitado]:C,[Ke.solo_lectura]:w,[Ke.invalido]:le,[Ke.valido]:he,[Ke.enfocado]:R,[Ke.tiene_contenido]:Y},P,O?.base);return r.jsxs("div",{className:bt,style:E,children:[f&&r.jsxs("label",{className:ne(Ke.etiqueta,O?.label),htmlFor:re,children:[f,y&&r.jsx("span",{className:Ke.marca_requerido,"aria-hidden":"true",children:"*"})]}),r.jsxs("div",{className:ne(Ke.envoltorio_input,O?.inputWrapper),children:[p&&r.jsx("span",{className:Ke.contenido_inicio,children:p}),r.jsx("div",{className:ne(Ke.envoltorio_interno,O?.innerWrapper),children:r.jsx("input",{...j,ref:W,id:re,name:$,type:K,value:ae?fe:void 0,defaultValue:ae?void 0:a,placeholder:i,disabled:C,readOnly:w,required:y,autoComplete:D,autoFocus:B,maxLength:X,minLength:U,pattern:L,"aria-invalid":le||void 0,"aria-describedby":ot,"aria-required":y,className:ne(Ke.entrada,O?.input),onChange:H,onFocus:de,onBlur:te,onKeyDown:Ye})}),q&&r.jsx("button",{type:"button",className:ne(Ke.boton_limpiar,O?.clearButton),onClick:pe,tabIndex:-1,"aria-label":"Limpiar campo",children:r.jsx(Zl,{size:"0.75em"})}),ce&&r.jsx("button",{type:"button",className:Ke.boton_password,onClick:Oe,tabIndex:-1,"aria-label":_e?"Ocultar contraseña":"Mostrar contraseña","aria-pressed":_e,children:_e?r.jsx(Kl,{}):r.jsx(Ul,{})}),v&&r.jsx("span",{className:Ke.contenido_final,children:v})]}),d&&!le&&r.jsx("div",{id:Ae,className:ne(Ke.descripcion,O?.description),children:d}),le&&Me&&r.jsx("div",{id:Ne,className:ne(Ke.mensaje_error,O?.errorMessage),role:"alert",children:Me})]})});Ma.displayName="InputText";function an(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function zn(e,n){if(e==null||Number.isNaN(e))return"";const{separadorMiles:t=!1,separadorDecimal:o=".",escalaDecimal:a,decimalesFijos:i=!1,prefijo:s="",sufijo:l=""}=n;let c;a!==void 0?c=i?e.toFixed(a):String(Math.round(e*Math.pow(10,a))/Math.pow(10,a)):c=String(e);const[u,_]=c.split(".");let g=u;if(t){const d=typeof t=="string"?t:",";g=u.replace(/\B(?=(\d{3})+(?!\d))/g,d)}let f=g;return _!==void 0?f+=o+_:i&&a&&a>0&&(f+=o+"0".repeat(a)),`${s}${f}${l}`}function Ia(e,n){if(!e||e.trim()==="")return;const{separadorMiles:t=!1,separadorDecimal:o=".",prefijo:a="",sufijo:i="",permitirNegativo:s=!0}=n;let l=e;if(a&&(l=l.replace(new RegExp(`^${an(a)}`),"")),i&&(l=l.replace(new RegExp(`${an(i)}$`),"")),t){const u=typeof t=="string"?t:",";l=l.replace(new RegExp(an(u),"g"),"")}o!=="."&&(l=l.replace(new RegExp(an(o)),".")),s||(l=l.replace(/-/g,""));const c=parseFloat(l);return Number.isNaN(c)?void 0:c}function sr(e,n,t){let o=e;return n!==void 0&&o<n&&(o=n),t!==void 0&&o>t&&(o=t),o}function Fa(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 za(e,n){const t=Math.pow(10,n);return Math.round(e*t)/t}function Xl(e,n){if(!e)return e;const{separadorMiles:t=!1,separadorDecimal:o=".",escalaDecimal:a,decimalesFijos:i=!1,prefijo:s="",sufijo:l=""}=n,c=e.startsWith("-"),u=c?e.slice(1):e,[_,g]=u.split(o);let f=g??"";a!==void 0&&(f=f.slice(0,a),i&&(f=f.padEnd(a,"0")));let d=_||"";if(t&&d){const p=typeof t=="string"?t:",";d=d.replace(/\B(?=(\d{3})+(?!\d))/g,p)}let m=(c?"-":"")+d;return g!==void 0?m+=o+f:i&&a&&a>0&&(m+=o+"0".repeat(a)),`${s}${m}${l}`}function La(e,n){const{separadorMiles:t,prefijo:o="",sufijo:a=""}=n;let i=e;if(o&&(i=i.replace(new RegExp(`^${an(o)}`),"")),a&&(i=i.replace(new RegExp(`${an(a)}$`),"")),t){const s=typeof t=="string"?t:",";i=i.replace(new RegExp(an(s),"g"),"")}return i}const Yl=e=>r.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:[r.jsx("path",{d:"M5 12h14"}),r.jsx("path",{d:"M12 5v14"})]}),Jl=e=>r.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:r.jsx("path",{d:"M5 12h14"})}),Xe={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"},Aa=h.forwardRef((e,n)=>{const{value:t,defaultValue:o,placeholder:a,variant:i="bordered",color:s="default",size:l="md",radius:c="md",fullWidth:u=!0,disableAnimation:_=!1,label:g,description:f,errorMessage:d,startContent:m,endContent:p,isRequired:v=!1,isReadOnly:y=!1,isDisabled:w=!1,isInvalid:C,validationState:k,validate:z,className:A,classNames:N,style:P,min:O,max:E,step:T=1,decimalScale:V,fixedDecimalScale:S=!1,thousandSeparator:b=!1,decimalSeparator:x=".",prefix:F="",suffix:I="",allowNegative:$=!0,allowDecimal:D=!0,hideControls:B=!1,clampBehavior:X="error",onChange:U,onValueChange:L,onFocus:j,onBlur:W,onKeyDown:ie,id:re,name:ae,...me}=e,ee=h.useRef(null),R=h.useRef(re??`input-numeric-${no(8)}`).current;h.useImperativeHandle(n,()=>ee.current);const se=t!==void 0,[_e,Se]=h.useState(o),[ge,le]=h.useState(""),[he,G]=h.useState(!1),Y=se?t===""?void 0:t:_e,ce=h.useMemo(()=>({separadorMiles:b,separadorDecimal:x,escalaDecimal:D?V:0,decimalesFijos:S,prefijo:F,sufijo:I,permitirNegativo:$}),[b,x,V,S,F,I,$,D]),K=h.useRef(Y);K.current=Y;const q=h.useRef(ce);q.current=ce;const H=h.useRef(he);H.current=he;const de=h.useRef(""),te=h.useMemo(()=>{if(X==="error"&&Y!==void 0){if(O!==void 0&&Y<O)return`El valor debe ser mayor o igual a ${O}`;if(E!==void 0&&Y>E)return`El valor debe ser menor o igual a ${E}`}if(!z)return null;const Ce=Fa(z(Y));return Ce.invalido?Ce.mensaje:null},[Y,z,X,O,E]),pe=h.useMemo(()=>C!==void 0?C:k==="invalid"?!0:k==="valid"?!1:!!te,[C,k,te]),Ye=k==="valid"&&!pe,Oe={invalido:pe,mensaje:te},Ae=h.useCallback(Ce=>{se||Se(Ce),U?.(Ce),L?.(zn(Ce,ce),Ce)},[se,U,L,ce]),Ne=h.useCallback(Ce=>{let xe=(Y??0)+T*Ce;X!=="error"&&(xe=sr(xe,O,E)),V!==void 0&&(xe=za(xe,V)),Ae(xe),le(zn(xe,ce))},[Y,T,O,E,X,V,Ae,ce]),ot=h.useCallback(Ce=>{if(w||y)return;const xe=x===","?",":".";let et="0-9";D&&(et+=xe),$&&(et+="-");let Be=Ce.target.value.replace(new RegExp(`[^${et}]`,"g"),"");if(D){const wt=Be.split(xe);wt.length>2&&(Be=wt[0]+xe+wt.slice(1).join(""))}if($&&Be.includes("-")){const wt=Be.replace(/-/g,"");Be=Be.startsWith("-")?"-"+wt:wt}de.current=Be,le(Be),Ae(Ia(Be,ce))},[w,y,ce,Ae,x,$,D]),Me=h.useCallback(Ce=>{const xe=La(de.current,q.current);de.current=xe,G(!0),xe&&le(xe),j?.(Ce)},[j]),bt=h.useCallback(Ce=>{const xe=K.current,et=q.current;if(G(!1),X==="blur"&&xe!==void 0){const Be=sr(xe,O,E);if(Be!==xe){Ae(Be),le(zn(Be,et)),W?.(Ce);return}}X!=="error"&&le(Xl(de.current,et)),W?.(Ce)},[X,O,E,Ae,W]),Te=h.useCallback(Ce=>{Ce.key==="ArrowUp"?(Ce.preventDefault(),Ne(1)):Ce.key==="ArrowDown"&&(Ce.preventDefault(),Ne(-1));const xe=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],et=Ce.ctrlKey||Ce.metaKey,Be=D&&(Ce.key===x||Ce.key==="."||Ce.key===","),wt=Ce.key==="-"&&$,Tt=/^[0-9]$/.test(Ce.key);!xe.includes(Ce.key)&&!et&&!Be&&!wt&&!Tt&&Ce.preventDefault(),ie?.(Ce)},[Ne,ie,x,$,D]);h.useEffect(()=>{if(!H.current){const Ce=zn(Y,ce);de.current=La(Ce,ce),le(Ce)}},[Y,ce]),h.useLayoutEffect(()=>{ee.current&&ee.current.setCustomValidity(X==="error"&&te?te:"")},[X,te]);const be=f?`${R}-desc`:void 0,Ge=pe?`${R}-err`:void 0,lt=[be,Ge].filter(Boolean).join(" ")||void 0,Ee=typeof d=="function"?d(Oe):d??te,rt=E===void 0||(Y??0)<E,St=O===void 0||(Y??0)>O,Et=ne(Xe.contenedor_base,Xe[`variante_${i}`],Xe[`tam_${l}`],Xe[`radio_${c}`],Xe[`color_${s}`],{[Xe.ancho_total]:u,[Xe.sin_animacion]:_,[Xe.deshabilitado]:w,[Xe.solo_lectura]:y,[Xe.invalido]:pe,[Xe.valido]:Ye,[Xe.enfocado]:he},A,N?.base);return r.jsxs("div",{className:Et,style:P,children:[g&&r.jsxs("label",{className:ne(Xe.etiqueta,N?.label),htmlFor:R,children:[g,v&&r.jsx("span",{className:Xe.marca_requerido,"aria-hidden":"true",children:"*"})]}),r.jsxs("div",{className:ne(Xe.envoltorio_input,N?.inputWrapper),children:[r.jsxs("div",{className:ne(Xe.envoltorio_interno,N?.innerWrapper),children:[m&&r.jsx("span",{className:Xe.contenido_inicio,children:m}),r.jsx("input",{...me,ref:ee,id:R,name:ae,type:"text",inputMode:"decimal",value:ge,placeholder:a,disabled:w,readOnly:y,required:v,"aria-invalid":pe||void 0,"aria-describedby":lt,"aria-required":v,className:ne(Xe.entrada,N?.input),onChange:ot,onFocus:Me,onBlur:bt,onKeyDown:Te}),p&&r.jsx("span",{className:Xe.contenido_final,children:p})]}),!B&&!y&&!w&&r.jsxs("div",{className:ne(Xe.controles,N?.controls),children:[r.jsx("button",{type:"button",tabIndex:-1,className:ne(Xe.boton_control,N?.controlButton),disabled:!St,onClick:()=>Ne(-1),"aria-label":"Decrementar valor",children:r.jsx(Jl,{})}),r.jsx("button",{type:"button",tabIndex:-1,className:ne(Xe.boton_control,N?.controlButton),disabled:!rt,onClick:()=>Ne(1),"aria-label":"Incrementar valor",children:r.jsx(Yl,{})})]})]}),f&&!pe&&r.jsx("div",{id:be,className:ne(Xe.descripcion,N?.description),children:f}),pe&&Ee&&r.jsx("div",{id:Ge,className:ne(Xe.mensaje_error,N?.errorMessage),role:"alert",children:Ee})]})});Aa.displayName="InputNumeric";function Ql(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 lr(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 Rl(){return new Date().toISOString().split("T")[0]}function ec(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 Re={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"},tc=()=>r.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:[r.jsx("circle",{cx:"12",cy:"12",r:"10"}),r.jsx("polyline",{points:"12 6 12 12 16 14"})]}),nc=()=>r.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:[r.jsx("path",{d:"M8 2v4"}),r.jsx("path",{d:"M16 2v4"}),r.jsx("rect",{height:"18",rx:"2",width:"18",x:"3",y:"4"}),r.jsx("path",{d:"M3 10h18"}),r.jsx("circle",{cx:"8",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),r.jsx("circle",{cx:"12",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),r.jsx("circle",{cx:"16",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),r.jsx("circle",{cx:"8",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),r.jsx("circle",{cx:"12",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),r.jsx("circle",{cx:"16",cy:"18",r:"1",fill:"currentColor",stroke:"none"})]}),oc=()=>r.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:[r.jsx("path",{d:"M18 6 6 18"}),r.jsx("path",{d:"m6 6 12 12"})]}),rc=({tipo:e,onClick:n,onMouseDown:t})=>r.jsx("button",{type:"button",tabIndex:-1,className:Re.boton_icono,onMouseDown:t,onClick:n,"aria-label":e==="time"?"Abrir selector de hora":"Abrir selector de fecha",children:e==="time"?r.jsx(tc,{}):r.jsx(nc,{})}),Da=h.forwardRef((e,n)=>{const{type:t="date",value:o,defaultValue:a,placeholder:i,variant:s="bordered",color:l="default",size:c="md",radius:u="md",fullWidth:_=!0,disableAnimation:g=!1,label:f,description:d,errorMessage:m,startContent:p,isRequired:v=!1,isReadOnly:y=!1,isDisabled:w=!1,isInvalid:C,validationState:k,validate:z,className:A,classNames:N,style:P,min:O,max:E,isClearable:T=!1,onChange:V,onFocus:S,onBlur:b,id:x,name:F,...I}=e,$=h.useRef(null),B=h.useRef(x??`input-date-${no(8)}`).current;h.useImperativeHandle(n,()=>$.current);const X=o!==void 0,[U,L]=h.useState(a??""),j=X?o:U,[W,ie]=h.useState(!1),re=h.useRef(!1),ae=h.useMemo(()=>{if(j&&t!=="time"&&(O||E)){if(O&&j<O)return`La fecha debe ser ${t==="date"?lr(O):O} o posterior`;if(E&&j>E)return`La fecha debe ser ${t==="date"?lr(E):E} o anterior`}if(!z)return null;const q=Ql(z(j));return q.invalido?q.mensaje:null},[j,z,O,E,t]),me=h.useMemo(()=>C!==void 0?C:k==="invalid"?!0:k==="valid"?!1:!!ae,[C,k,ae]),ee=k==="valid"&&!me,fe={invalido:me,mensaje:ae},R=h.useCallback(q=>{if(w||y)return;re.current=!1;const H=q.target.value;X||L(H),V?.(H)},[X,w,y,V]),se=h.useCallback(q=>{ie(!0),S?.(q)},[S]),_e=h.useCallback(q=>{ie(!1),re.current=!1,b?.(q)},[b]),Se=h.useCallback(q=>{q.preventDefault()},[]),ge=h.useCallback(q=>{if(q.preventDefault(),q.stopPropagation(),!(!$.current||w||y)){if(re.current){re.current=!1,$.current.blur();return}$.current.focus();try{$.current.showPicker?.(),re.current=!0}catch{}}},[w,y]),le=h.useCallback(q=>{q.preventDefault(),q.stopPropagation(),re.current=!1,X||L(""),V?.(""),$.current?.focus()},[X,V]),he=d?`${B}-desc`:void 0,G=me?`${B}-err`:void 0,Y=[he,G].filter(Boolean).join(" ")||void 0,ce=typeof m=="function"?m(fe):m??ae,K=ne(Re.contenedor_base,Re[`variante_${s}`],Re[`tam_${c}`],Re[`radio_${u}`],Re[`color_${l}`],{[Re.ancho_total]:_,[Re.sin_animacion]:g,[Re.deshabilitado]:w,[Re.solo_lectura]:y,[Re.invalido]:me,[Re.valido]:ee,[Re.enfocado]:W},A,N?.base);return r.jsxs("div",{className:K,style:P,children:[f&&r.jsxs("label",{className:ne(Re.etiqueta,N?.label),htmlFor:B,children:[f,v&&r.jsx("span",{className:Re.marca_requerido,"aria-hidden":"true",children:"*"})]}),r.jsx("div",{className:ne(Re.envoltorio_input,N?.inputWrapper),children:r.jsxs("div",{className:ne(Re.envoltorio_interno,N?.innerWrapper),children:[p&&r.jsx("span",{className:Re.contenido_inicio,children:p}),r.jsx("input",{...I,ref:$,id:B,name:F,type:t,value:X?j:void 0,defaultValue:X?void 0:a,placeholder:i,disabled:w,readOnly:y,required:v,min:O,max:E,"aria-invalid":me||void 0,"aria-describedby":Y,"aria-required":v,className:ne(Re.entrada,N?.input),onChange:R,onFocus:se,onBlur:_e}),T&&j&&!w&&!y&&r.jsx("button",{type:"button",tabIndex:-1,className:ne(Re.boton_limpiar,N?.clearButton),onMouseDown:q=>q.preventDefault(),onClick:le,"aria-label":"Limpiar fecha",children:r.jsx(oc,{})}),r.jsx(rc,{tipo:t,onClick:ge,onMouseDown:Se})]})}),d&&!me&&r.jsx("div",{id:he,className:ne(Re.descripcion,N?.description),children:d}),me&&ce&&r.jsx("div",{id:G,className:ne(Re.mensaje_error,N?.errorMessage),role:"alert",children:ce})]})});Da.displayName="InputDate";const ac={desvanecerDeslizar:"desvanecer_deslizar",escalar:"escalar"};function oo({mostrar:e,children:n,tipo:t="desvanecerDeslizar",className:o,...a}){const[i,s]=h.useState(e),[l,c]=h.useState(e?"entrada":null);e&&!i?(s(!0),c("entrada")):!e&&i&&l!=="salida"&&c("salida");const u=()=>{l==="entrada"?c(null):l==="salida"&&(s(!1),c(null))};if(!i)return null;const _=ac[t||"desvanecer"],g=l?`transicion_${_}_${l}`:"";return r.jsx("div",{...a,onAnimationEnd:u,className:`${g} ${o||""}`.trim(),children:n})}const Vt={badges_wrap:"_badges_wrap_1dfuw_15",badges_wrap_visible:"_badges_wrap_visible_1dfuw_23",acciones_grupo:"_acciones_grupo_1dfuw_33",badge_voz:"_badge_voz_1dfuw_41",badge_sm:"_badge_sm_1dfuw_73",badge_md:"_badge_md_1dfuw_85",badge_lg:"_badge_lg_1dfuw_97",badge_estirada:"_badge_estirada_1dfuw_109",badge_icono:"_badge_icono_1dfuw_129",badge_texto:"_badge_texto_1dfuw_155",badge_mic:"_badge_mic_1dfuw_165",badge_tts:"_badge_tts_1dfuw_173",badge_ondas:"_badge_ondas_1dfuw_181",badgeOnda:"_badgeOnda_1dfuw_1",badge_eq:"_badge_eq_1dfuw_219",badgeEq:"_badgeEq_1dfuw_1"};function cr(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",...e,children:r.jsxs("g",{fill:"currentColor",children:[r.jsx("path",{d:"M5 3a3 3 0 0 1 6 0v4a3 3 0 0 1-6 0z"}),r.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 dr(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",...e,children:r.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 Pa(e){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 21",...e,children:[r.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"currentColor",opacity:".5"}),r.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 ur({tipo:e,texto:n,size:t="md",estirar:o}){const a=e==="mic";return r.jsxs("span",{className:ne(Vt.badge_voz,a?Vt.badge_mic:Vt.badge_tts,Vt[`badge_${t}`],o&&Vt.badge_estirada),"data-tipo":e,children:[r.jsx("span",{className:Vt.badge_icono,children:a?r.jsx(cr,{}):r.jsx(dr,{})}),r.jsx("span",{className:Vt.badge_texto,children:n}),a?r.jsxs("span",{className:Vt.badge_ondas,"aria-hidden":"true",children:[r.jsx("span",{}),r.jsx("span",{}),r.jsx("span",{})]}):r.jsxs("span",{className:Vt.badge_eq,"aria-hidden":"true",children:[r.jsx("span",{}),r.jsx("span",{}),r.jsx("span",{}),r.jsx("span",{})]})]})}function Ta({value:e,onChange:n,isDisabled:t,isReadOnly:o,onDictadoCompleto:a,idioma:i="es-ES"}){const[s,l]=h.useState(!1),[c,u]=h.useState(!1),[_,g]=h.useState(null),f=h.useRef(null),d=h.useRef(null),m=h.useRef(null),p=h.useRef(""),v=typeof window<"u"&&"speechSynthesis"in window,y=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),w=h.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null),v&&window.speechSynthesis.cancel(),d.current=null,l(!1)},[v]),C=h.useCallback(()=>{if(!v||!e)return;if(w(),f.current){try{f.current.stop()}catch(N){console.error("Error stopping recognition:",N)}f.current=null,u(!1)}const A=new SpeechSynthesisUtterance(e);A.lang=i,A.onstart=()=>l(!0),A.onend=()=>{l(!1),d.current=null},A.onerror=()=>{l(!1),d.current=null},d.current=A,window.speechSynthesis.speak(A)},[v,e,i,w]),k=h.useCallback(()=>{if(f.current)try{f.current.stop()}catch(A){console.error("Error stopping recognition:",A)}u(!1),g(null)},[]),z=h.useCallback(()=>{if(!y||t||o)return;w();const A=window,N=A.SpeechRecognition||A.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),f.current=null,a?.()},P.onerror=O=>{O.error!=="no-speech"&&(u(!1),f.current=null,O.error!=="aborted"&&g("Error al reconocer voz"))},P.onresult=O=>{try{let E="";for(let S=0;S<O.results.length;S++)E+=O.results[S][0].transcript;const T=p.current&&E?" ":"",V=p.current+T+E;n(V)}catch{g("Error procesando dictado")}},f.current=P,P.start()}catch{g("No se pudo iniciar dictado"),u(!1)}},[y,t,o,e,n,i,w,a]);return h.useEffect(()=>()=>{m.current&&clearTimeout(m.current),v&&window.speechSynthesis.cancel(),f.current&&f.current.abort()},[v]),{puedeHablar:v,puedeEscuchar:y,hablando:s,escuchando:c,errorDictado:_,escuchar:C,detenerHablar:w,dictar:z,detenerDictado:k}}function ic({size:e="1em",className:n}){return r.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:[r.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}const je={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"},Oa=h.forwardRef((e,n)=>{const{children:t,variant:o="bordered",color:a="default",size:i="md",radius:s="md",fullWidth:l=!0,disableAnimation:c=!1,label:u,description:_,errorMessage:g,value:f,defaultValue:d,placeholder:m,isRequired:p=!1,isReadOnly:v=!1,isDisabled:y=!1,isClearable:w=!1,isInvalid:C,validationState:k,validate:z,minRows:A=4,maxRows:N=10,disableAutosize:P=!1,hideVoiceActions:O=!1,className:E,classNames:T,style:V,onChange:S,onClear:b,onFocus:x,onBlur:F,id:I,name:$,rows:D,...B}=e,X=h.useRef(null),L=h.useRef(I??`textarea-${no(8)}`).current;h.useImperativeHandle(n,()=>X.current);const j=f!==void 0,[W,ie]=h.useState(d??""),re=j?f:W,[ae,me]=h.useState(!1),ee=h.useMemo(()=>{if(!z)return null;const Ee=z(re);return Ee===!0||Ee==null?null:typeof Ee=="string"?Ee:typeof Ee=="object"&&"message"in Ee?Ee.message??"Entrada inválida":"Entrada inválida"},[re,z]),fe=h.useMemo(()=>C!==void 0?C:k==="invalid"?!0:k==="valid"?!1:!!ee,[C,k,ee]),R=k==="valid"&&!fe,se={invalido:fe,mensaje:ee},_e=re.length>0,Se=h.useCallback(()=>{if(!X.current||P)return;const Ee=X.current,rt=window.getComputedStyle(Ee),St=parseFloat(rt.lineHeight)||parseFloat(rt.fontSize)*1.5,Et=parseFloat(rt.paddingTop)||0,Ce=parseFloat(rt.paddingBottom)||0,xe=parseFloat(rt.borderTopWidth)||0,et=parseFloat(rt.borderBottomWidth)||0,Be=A*St+Et+Ce+xe+et,wt=N*St+Et+Ce+xe+et;Ee.style.height="auto";const Tt=Ee.scrollHeight;Ee.style.height=`${Math.min(Math.max(Tt,Be),wt)}px`},[P,A,N]);h.useEffect(()=>{P||Se()},[re,Se,P]);const ge=h.useCallback(Ee=>{j||ie(Ee),S?.(Ee)},[j,S]),{puedeHablar:le,hablando:he,escuchar:G,detenerHablar:Y,puedeEscuchar:ce,escuchando:K,errorDictado:q,dictar:H,detenerDictado:de}=Ta({isDisabled:y||O,isReadOnly:v,value:re,onChange:ge}),te=h.useCallback(Ee=>{if(y||v)return;const rt=Ee.target.value;j||ie(rt),S?.(rt)},[j,y,v,S]),pe=h.useCallback(Ee=>{me(!0),x?.(Ee)},[x]),Ye=h.useCallback(Ee=>{me(!1),F?.(Ee)},[F]),Oe=h.useCallback(()=>{y||v||(j||ie(""),S?.(""),b?.(),X.current?.focus())},[j,y,v,S,b]),Ae=h.useCallback(()=>{he?Y():G()},[he,G,Y]),Ne=h.useCallback(()=>{K?de():H()},[K,H,de]),ot=_?`${L}-desc`:void 0,Me=fe||q?`${L}-err`:void 0,bt=[ot,Me].filter(Boolean).join(" ")||void 0,Te=typeof g=="function"?g(se):g??ee,be=w&&_e&&!v&&!y,Ge=!O||be,lt=ne(je.contenedor_base,je[`variante_${o}`],je[`tam_${i}`],je[`radio_${s}`],je[`color_${a}`],{[je.ancho_total]:l,[je.sin_animacion]:c,[je.deshabilitado]:y,[je.solo_lectura]:v,[je.invalido]:fe,[je.valido]:R,[je.enfocado]:ae},E,T?.base);return r.jsxs("div",{className:lt,style:V,children:[u&&r.jsxs("label",{className:ne(je.etiqueta,T?.label),htmlFor:L,children:[u,p&&r.jsx("span",{className:je.marca_requerido,"aria-hidden":"true",children:"*"})]}),r.jsxs("div",{className:ne(je.envoltorio_input,T?.inputWrapper),children:[r.jsx("textarea",{...B,ref:X,id:L,name:$,placeholder:m,value:j?re:void 0,defaultValue:j?void 0:d,onChange:te,onFocus:pe,onBlur:Ye,className:ne(je.entrada,P&&je.sin_autosize,T?.input),readOnly:v,disabled:y,rows:D??A,"aria-invalid":fe||void 0,"aria-describedby":bt,"aria-required":p,required:p}),Ge&&r.jsxs("div",{className:ne(je.barra_acciones,T?.actions),children:[r.jsxs("div",{className:je.badges_contenedor,"aria-live":"polite",role:"status",children:[r.jsx(oo,{mostrar:K,children:r.jsx(ur,{tipo:"mic",texto:"Escuchando...",size:i==="lg"?"md":"sm"})}),r.jsx(oo,{mostrar:he,children:r.jsx(ur,{tipo:"tts",texto:"Leyendo...",size:i==="lg"?"md":"sm"})})]}),r.jsxs("div",{className:je.botones_grupo,children:[!O&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:ne(je.boton_accion,he&&je.boton_activo_tts),onClick:Ae,disabled:!le||!he&&(!re||K),title:he?"Detener lectura":"Leer texto","aria-pressed":he,"aria-label":he?"Detener lectura":"Leer texto",children:r.jsx(dr,{})}),ce&&r.jsx("button",{type:"button",className:ne(je.boton_accion,K&&je.boton_activo_mic),onClick:Ne,disabled:y||v||he,title:K?"Detener dictado":"Dictar texto","aria-pressed":K,"aria-label":K?"Detener dictado":"Dictar texto",children:K?r.jsx(Pa,{}):r.jsx(cr,{})})]}),be&&r.jsx("button",{type:"button",className:je.boton_limpiar,onClick:Oe,title:"Limpiar campo","aria-label":"Limpiar campo",children:r.jsx(ic,{size:"0.75em"})})]})]})]}),_&&!fe&&r.jsx("div",{id:ot,className:ne(je.descripcion,T?.description),children:_}),fe&&Te||q?r.jsxs("div",{id:Me,className:ne(je.mensaje_error,T?.errorMessage),role:"alert",children:[Te,Te&&q&&r.jsx("br",{}),q&&r.jsxs("span",{children:["Error de voz: ",q]})]}):null,t]})});Oa.displayName="TextArea";function ro(){return typeof window<"u"}function Kt(e){return _r(e)?(e.nodeName||"").toLowerCase():"#document"}function vt(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function Lt(e){var n;return(n=(_r(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function _r(e){return ro()?e instanceof Node||e instanceof vt(e).Node:!1}function qe(e){return ro()?e instanceof Element||e instanceof vt(e).Element:!1}function tt(e){return ro()?e instanceof HTMLElement||e instanceof vt(e).HTMLElement:!1}function ao(e){return!ro()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vt(e).ShadowRoot}const sc=new Set(["inline","contents"]);function Ln(e){const{overflow:n,overflowX:t,overflowY:o,display:a}=Ct(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+t)&&!sc.has(a)}const lc=new Set(["table","td","th"]);function cc(e){return lc.has(Kt(e))}const dc=[":popover-open",":modal"];function io(e){return dc.some(n=>{try{return e.matches(n)}catch{return!1}})}const uc=["transform","translate","scale","rotate","perspective"],_c=["transform","translate","scale","rotate","perspective","filter"],fc=["paint","layout","strict","content"];function fr(e){const n=so(),t=qe(e)?Ct(e):e;return uc.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)||_c.some(o=>(t.willChange||"").includes(o))||fc.some(o=>(t.contain||"").includes(o))}function pc(e){let n=jt(e);for(;tt(n)&&!Bt(n);){if(fr(n))return n;if(io(n))return null;n=jt(n)}return null}function so(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const gc=new Set(["html","body","#document"]);function Bt(e){return gc.has(Kt(e))}function Ct(e){return vt(e).getComputedStyle(e)}function lo(e){return qe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jt(e){if(Kt(e)==="html")return e;const n=e.assignedSlot||e.parentNode||ao(e)&&e.host||Lt(e);return ao(n)?n.host:n}function Va(e){const n=jt(e);return Bt(n)?e.ownerDocument?e.ownerDocument.body:e.body:tt(n)&&Ln(n)?n:Va(n)}function Xt(e,n,t){var o;n===void 0&&(n=[]),t===void 0&&(t=!0);const a=Va(e),i=a===((o=e.ownerDocument)==null?void 0:o.body),s=vt(a);if(i){const l=pr(s);return n.concat(s,s.visualViewport||[],Ln(a)?a:[],l&&t?Xt(l):[])}return n.concat(a,Xt(a,[],t))}function pr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Yt=Math.min,xt=Math.max,co=Math.round,vn=Math.floor,At=e=>({x:e,y:e}),hc={left:"right",right:"left",bottom:"top",top:"bottom"},mc={start:"end",end:"start"};function gr(e,n,t){return xt(e,Yt(n,t))}function bn(e,n){return typeof e=="function"?e(n):e}function Jt(e){return e.split("-")[0]}function wn(e){return e.split("-")[1]}function Ba(e){return e==="x"?"y":"x"}function hr(e){return e==="y"?"height":"width"}const vc=new Set(["top","bottom"]);function qt(e){return vc.has(Jt(e))?"y":"x"}function mr(e){return Ba(qt(e))}function bc(e,n,t){t===void 0&&(t=!1);const o=wn(e),a=mr(e),i=hr(a);let s=a==="x"?o===(t?"end":"start")?"right":"left":o==="start"?"bottom":"top";return n.reference[i]>n.floating[i]&&(s=uo(s)),[s,uo(s)]}function wc(e){const n=uo(e);return[vr(e),n,vr(n)]}function vr(e){return e.replace(/start|end/g,n=>mc[n])}const ja=["left","right"],qa=["right","left"],yc=["top","bottom"],Cc=["bottom","top"];function xc(e,n,t){switch(e){case"top":case"bottom":return t?n?qa:ja:n?ja:qa;case"left":case"right":return n?yc:Cc;default:return[]}}function $c(e,n,t,o){const a=wn(e);let i=xc(Jt(e),t==="start",o);return a&&(i=i.map(s=>s+"-"+a),n&&(i=i.concat(i.map(vr)))),i}function uo(e){return e.replace(/left|right|bottom|top/g,n=>hc[n])}function Sc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ha(e){return typeof e!="number"?Sc(e):{top:e,right:e,bottom:e,left:e}}function _o(e){const{x:n,y:t,width:o,height:a}=e;return{width:o,height:a,top:t,left:n,right:n+o,bottom:t+a,x:n,y:t}}/*!
2
2
  * tabbable 6.3.0
3
3
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
4
- */var Wl=["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])"],no=Wl.join(","),Ei=typeof Element>"u",pt=Ei?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,to=!Ei&&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},Et=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"),s=r===""||r==="true",a=s||n&&t&&Et(t.parentNode);return a},Kl=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},Mi=function(t,n,o){if(Et(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(no));return n&&pt.call(t,no)&&r.unshift(t),r=r.filter(o),r},oo=function(t,n,o){for(var r=[],s=Array.from(t);s.length;){var a=s.shift();if(!Et(a,!1))if(a.tagName==="SLOT"){var l=a.assignedElements(),d=l.length?l:a.children,u=oo(d,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else{var _=pt.call(a,no);_&&o.filter(a)&&(n||!t.includes(a))&&r.push(a);var p=a.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(a),f=!Et(p,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(p&&f){var c=oo(p===!0?a.children:p.children,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:a,candidates:c})}else s.unshift.apply(s,a.children)}}return r},Ni=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Fi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Kl(t))&&!Ni(t)?0:t.tabIndex},Ul=function(t,n){var o=Fi(t);return o<0&&n&&!Ni(t)?0:o},Xl=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Ai=function(t){return t.tagName==="INPUT"},Yl=function(t){return Ai(t)&&t.type==="hidden"},Zl=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},Jl=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Ql=function(t){if(!t.name)return!0;var n=t.form||to(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 s=Jl(r,t.form);return!s||s===t},Rl=function(t){return Ai(t)&&t.type==="radio"},ec=function(t){return Rl(t)&&!Ql(t)},nc=function(t){var n,o=t&&to(t),r=(n=o)===null||n===void 0?void 0:n.host,s=!1;if(o&&o!==t){var a,l,d;for(s=!!((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));!s&&r;){var u,_,p;o=to(r),r=(u=o)===null||u===void 0?void 0:u.host,s=!!((_=r)!==null&&_!==void 0&&(p=_.ownerDocument)!==null&&p!==void 0&&p.contains(r))}}return s},Li=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},tc=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var a=pt.call(t,"details>summary:first-of-type"),l=a?t.parentElement:t;if(pt.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,_=to(t);if(u&&!u.shadowRoot&&r(u)===!0)return Li(t);t.assignedSlot?t=t.assignedSlot:!u&&_!==t.ownerDocument?t=_.host:t=u}t=d}if(nc(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Li(t);return!1},oc=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 pt.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},or=function(t,n){return!(n.disabled||Et(n)||Yl(n)||tc(n,t)||Zl(n)||oc(n))},rr=function(t,n){return!(ec(n)||Fi(n)<0||!or(t,n))},rc=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Di=function(t){var n=[],o=[];return t.forEach(function(r,s){var a=!!r.scopeParent,l=a?r.scopeParent:r,d=Ul(l,a),u=a?Di(r.candidates):l;d===0?a?n.push.apply(n,u):n.push(l):o.push({documentOrder:s,tabIndex:d,item:r,isScope:a,content:u})}),o.sort(Xl).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(n)},ro=function(t,n){n=n||{};var o;return n.getShadowRoot?o=oo([t],n.includeContainer,{filter:rr.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:rc}):o=Mi(t,n.includeContainer,rr.bind(null,n)),Di(o)},ic=function(t,n){n=n||{};var o;return n.getShadowRoot?o=oo([t],n.includeContainer,{filter:or.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=Mi(t,n.includeContainer,or.bind(null,n)),o},zi=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return pt.call(t,no)===!1?!1:rr(n,t)};function Pi(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Ti(){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 Oi(){return/apple/i.test(navigator.vendor)}function ir(){const e=/android/i;return e.test(Pi())||e.test(Ti())}function sc(){return Pi().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Vi(){return Ti().includes("jsdom/")}const qi="data-floating-ui-focusable",ac="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",sr="ArrowLeft",ar="ArrowRight",lc="ArrowUp",cc="ArrowDown";function Fn(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 ln(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Xt(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Vn(e){return"composedPath"in e?e.composedPath()[0]:e.target}function lr(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 dc(e){return e.matches("html,body")}function cn(e){return e?.ownerDocument||document}function cr(e){return Je(e)&&e.matches(ac)}function dr(e){return e?e.getAttribute("role")==="combobox"&&cr(e):!1}function uc(e){if(!e||Vi())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function io(e){return e?e.hasAttribute(qi)?e:e.querySelector("["+qi+"]")||e:null}function ot(e,t,n){return n===void 0&&(n=!0),e.filter(r=>{var s;return r.parentId===t&&(!n||((s=r.context)==null?void 0:s.open))}).flatMap(r=>[r,...ot(e,r.id,n)])}function fc(e,t){let n,o=-1;function r(s,a){a>o&&(n=s,o=a),ot(e,s).forEach(d=>{r(d.id,a+1)})}return r(t,0),e.find(s=>s.id===n)}function ji(e,t){var n;let o=[],r=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;r;){const s=e.find(a=>a.id===r);r=s?.parentId,s&&(o=o.concat(s))}return o}function dn(e){e.preventDefault(),e.stopPropagation()}function _c(e){return"nativeEvent"in e}function Bi(e){return e.mozInputSource===0&&e.isTrusted?!0:ir()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Hi(e){return Vi()?!1:!ir()&&e.width===0&&e.height===0||ir()&&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 Mt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var gc=typeof document<"u",pc=function(){},Ve=gc?m.useLayoutEffect:pc;const hc={...E};function an(e){const t=E.useRef(e);return Ve(()=>{t.current=e}),t}const mc=hc.useInsertionEffect||(e=>e());function Qe(e){const t=E.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return mc(()=>{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 so(e,t,n){return Math.floor(e/t)!==n}function Nt(e,t){return t<0||t>=e.current.length}function ur(e,t){return fn(e,{disabledIndices:t})}function Gi(e,t){return fn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function fn(e,t){let{startingIndex:n=-1,decrement:o=!1,disabledIndices:r,amount:s=1}=t===void 0?{}:t,a=n;do a+=o?-s:s;while(a>=0&&a<=e.current.length-1&&ao(e,a,r));return a}function vc(e,t){let{event:n,orientation:o,loop:r,rtl:s,cols:a,disabledIndices:l,minIndex:d,maxIndex:u,prevIndex:_,stopEvent:p=!1}=t,f=_;if(n.key===lc){if(p&&dn(n),_===-1)f=u;else if(f=fn(e,{startingIndex:f,amount:a,decrement:!0,disabledIndices:l}),r&&(_-a<d||f<0)){const c=_%a,h=u%a,g=u-(h-c);h===c?f=u:f=h>c?g:g-a}Nt(e,f)&&(f=_)}if(n.key===cc&&(p&&dn(n),_===-1?f=d:(f=fn(e,{startingIndex:_,amount:a,disabledIndices:l}),r&&_+a>u&&(f=fn(e,{startingIndex:_%a-a,amount:a,disabledIndices:l}))),Nt(e,f)&&(f=_)),o==="both"){const c=ft(_/a);n.key===(s?sr:ar)&&(p&&dn(n),_%a!==a-1?(f=fn(e,{startingIndex:_,disabledIndices:l}),r&&so(f,a,c)&&(f=fn(e,{startingIndex:_-_%a-1,disabledIndices:l}))):r&&(f=fn(e,{startingIndex:_-_%a-1,disabledIndices:l})),so(f,a,c)&&(f=_)),n.key===(s?ar:sr)&&(p&&dn(n),_%a!==0?(f=fn(e,{startingIndex:_,decrement:!0,disabledIndices:l}),r&&so(f,a,c)&&(f=fn(e,{startingIndex:_+(a-_%a),decrement:!0,disabledIndices:l}))):r&&(f=fn(e,{startingIndex:_+(a-_%a),decrement:!0,disabledIndices:l})),so(f,a,c)&&(f=_));const h=ft(u/a)===c;Nt(e,f)&&(r&&h?f=n.key===(s?ar:sr)?u:fn(e,{startingIndex:_-_%a-1,disabledIndices:l}):f=_)}return f}function bc(e,t,n){const o=[];let r=0;return e.forEach((s,a)=>{let{width:l,height:d}=s;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 _=[];for(let p=0;p<l;p++)for(let f=0;f<d;f++)_.push(r+p+f*t);r%t+l<=t&&_.every(p=>o[p]==null)?(_.forEach(p=>{o[p]=a}),u=!0):r++}}),[...o]}function wc(e,t,n,o,r){if(e===-1)return-1;const s=n.indexOf(e),a=t[e];switch(r){case"tl":return s;case"tr":return a?s+a.width-1:s;case"bl":return a?s+(a.height-1)*o:s;case"br":return n.lastIndexOf(e)}}function yc(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function ao(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 Ft=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Wi(e,t){const n=ro(e,Ft()),o=n.length;if(o===0)return;const r=Fn(cn(e)),s=n.indexOf(r),a=s===-1?t===1?0:o-1:s+t;return n[a]}function Ki(e){return Wi(cn(e).body,1)||e}function Ui(e){return Wi(cn(e).body,-1)||e}function At(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!ln(n,o)}function Cc(e){ro(e,Ft()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Xi(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 Yi(e,t,n){let{reference:o,floating:r}=e;const s=On(t),a=nr(t),l=er(a),d=Un(t),u=s==="y",_=o.x+o.width/2-r.width/2,p=o.y+o.height/2-r.height/2,f=o[l]/2-r[l]/2;let c;switch(d){case"top":c={x:_,y:o.y-r.height};break;case"bottom":c={x:_,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(gt(t)){case"start":c[a]-=f*(n&&u?-1:1);break;case"end":c[a]+=f*(n&&u?-1:1);break}return c}const xc=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:a}=n,l=s.filter(Boolean),d=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:_,y:p}=Yi(u,o,d),f=o,c={},h=0;for(let g=0;g<l.length;g++){const{name:v,fn:w}=l[g],{x:y,y:x,data:k,reset:L}=await w({x:_,y:p,initialPlacement:o,placement:f,strategy:r,middlewareData:c,rects:u,platform:a,elements:{reference:e,floating:t}});_=y??_,p=x??p,c={...c,[v]:{...c[v],...k}},L&&h<=50&&(h++,typeof L=="object"&&(L.placement&&(f=L.placement),L.rects&&(u=L.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:r}):L.rects),{x:_,y:p}=Yi(u,f,d)),g=-1)}return{x:_,y:p,placement:f,strategy:r,middlewareData:c}};async function fr(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:a,elements:l,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:_="viewport",elementContext:p="floating",altBoundary:f=!1,padding:c=0}=_t(t,e),h=Ii(c),v=l[f?p==="floating"?"reference":"floating":p],w=eo(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:u,rootBoundary:_,strategy:d})),y=p==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),k=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},L=eo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:x,strategy:d}):y);return{top:(w.top-L.top+h.top)/k.y,bottom:(L.bottom-w.bottom+h.bottom)/k.y,left:(w.left-L.left+h.left)/k.x,right:(L.right-w.right+h.right)/k.x}}const $c=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:a,elements:l,middlewareData:d}=t,{element:u,padding:_=0}=_t(e,t)||{};if(u==null)return{};const p=Ii(_),f={x:n,y:o},c=nr(r),h=er(c),g=await a.getDimensions(u),v=c==="y",w=v?"top":"left",y=v?"bottom":"right",x=v?"clientHeight":"clientWidth",k=s.reference[h]+s.reference[c]-f[c]-s.floating[h],L=f[c]-s.reference[c],A=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let M=A?A[x]:0;(!M||!await(a.isElement==null?void 0:a.isElement(A)))&&(M=l.floating[x]||s.floating[h]);const T=k/2-L/2,P=M/2-g[h]/2-1,I=Kn(p[w],P),q=Kn(p[y],P),V=I,S=M-g[h]-q,b=M/2-g[h]/2+T,$=Ro(V,b,S),D=!d.arrow&&gt(r)!=null&&b!==$&&s.reference[h]/2-(b<V?I:q)-g[h]/2<0,N=D?b<V?b-V:b-S:0;return{[c]:f[c]+N,data:{[c]:$,centerOffset:b-$-N,...D&&{alignmentOffset:N}},reset:D}}}),Sc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:a,initialPlacement:l,platform:d,elements:u}=t,{mainAxis:_=!0,crossAxis:p=!0,fallbackPlacements:f,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...v}=_t(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=Un(r),y=On(l),x=Un(l)===l,k=await(d.isRTL==null?void 0:d.isRTL(u.floating)),L=f||(x||!g?[Rt(l)]:Vl(l)),A=h!=="none";!f&&A&&L.push(...Hl(l,g,h,k));const M=[l,...L],T=await fr(t,v),P=[];let I=((o=s.flip)==null?void 0:o.overflows)||[];if(_&&P.push(T[w]),p){const b=Ol(r,a,k);P.push(T[b[0]],T[b[1]])}if(I=[...I,{placement:r,overflows:P}],!P.every(b=>b<=0)){var q,V;const b=(((q=s.flip)==null?void 0:q.index)||0)+1,$=M[b];if($&&(!(p==="alignment"?y!==On($):!1)||I.every(C=>On(C.placement)===y?C.overflows[0]>0:!0)))return{data:{index:b,overflows:I},reset:{placement:$}};let D=(V=I.filter(N=>N.overflows[0]<=0).sort((N,C)=>N.overflows[1]-C.overflows[1])[0])==null?void 0:V.placement;if(!D)switch(c){case"bestFit":{var S;const N=(S=I.filter(C=>{if(A){const z=On(C.placement);return z===y||z==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(z=>z>0).reduce((z,O)=>z+O,0)]).sort((C,z)=>C[1]-z[1])[0])==null?void 0:S[0];N&&(D=N);break}case"initialPlacement":D=l;break}if(r!==D)return{reset:{placement:D}}}return{}}}},kc=new Set(["left","top"]);async function Ic(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),a=Un(n),l=gt(n),d=On(n)==="y",u=kc.has(a)?-1:1,_=s&&d?-1:1,p=_t(t,e);let{mainAxis:f,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*_,y:f*u}:{x:f*u,y:c*_}}const Ec=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:a,middlewareData:l}=t,d=await Ic(t,e);return a===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:r+d.x,y:s+d.y,data:{...d,placement:a}}}}},Mc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:v=>{let{x:w,y}=v;return{x:w,y}}},...d}=_t(e,t),u={x:n,y:o},_=await fr(t,d),p=On(Un(r)),f=$i(p);let c=u[f],h=u[p];if(s){const v=f==="y"?"top":"left",w=f==="y"?"bottom":"right",y=c+_[v],x=c-_[w];c=Ro(y,c,x)}if(a){const v=p==="y"?"top":"left",w=p==="y"?"bottom":"right",y=h+_[v],x=h-_[w];h=Ro(y,h,x)}const g=l.fn({...t,[f]:c,[p]:h});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[f]:s,[p]:a}}}}}},Nc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:a,elements:l}=t,{apply:d=()=>{},...u}=_t(e,t),_=await fr(t,u),p=Un(r),f=gt(r),c=On(r)==="y",{width:h,height:g}=s.floating;let v,w;p==="top"||p==="bottom"?(v=p,w=f===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(w=p,v=f==="end"?"top":"bottom");const y=g-_.top-_.bottom,x=h-_.left-_.right,k=Kn(g-_[v],y),L=Kn(h-_[w],x),A=!t.middlewareData.shift;let M=k,T=L;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=x),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(M=y),A&&!f){const I=yn(_.left,0),q=yn(_.right,0),V=yn(_.top,0),S=yn(_.bottom,0);c?T=h-2*(I!==0||q!==0?I+q:yn(_.left,_.right)):M=g-2*(V!==0||S!==0?V+S:yn(_.top,_.bottom))}await d({...t,availableWidth:T,availableHeight:M});const P=await a.getDimensions(l.floating);return h!==P.width||g!==P.height?{reset:{rects:!0}}:{}}}};function Zi(e){const t=wn(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Je(e),s=r?e.offsetWidth:n,a=r?e.offsetHeight:o,l=Qt(n)!==s||Qt(o)!==a;return l&&(n=s,o=a),{width:n,height:o,$:l}}function _r(e){return Oe(e)?e:e.contextElement}function ht(e){const t=_r(e);if(!Je(t))return Nn(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=Zi(t);let a=(s?Qt(n.width):n.width)/o,l=(s?Qt(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const Fc=Nn(0);function Ji(e){const t=vn(e);return!Zt()||!t.visualViewport?Fc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ac(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==vn(e)?!1:t}function rt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=_r(e);let a=Nn(1);t&&(o?Oe(o)&&(a=ht(o)):a=ht(e));const l=Ac(s,n,o)?Ji(s):Nn(0);let d=(r.left+l.x)/a.x,u=(r.top+l.y)/a.y,_=r.width/a.x,p=r.height/a.y;if(s){const f=vn(s),c=o&&Oe(o)?vn(o):o;let h=f,g=Qo(h);for(;g&&o&&c!==h;){const v=ht(g),w=g.getBoundingClientRect(),y=wn(g),x=w.left+(g.clientLeft+parseFloat(y.paddingLeft))*v.x,k=w.top+(g.clientTop+parseFloat(y.paddingTop))*v.y;d*=v.x,u*=v.y,_*=v.x,p*=v.y,d+=x,u+=k,h=vn(g),g=Qo(h)}}return eo({width:_,height:p,x:d,y:u})}function lo(e,t){const n=Jt(e).scrollLeft;return t?t.left+n:rt(Mn(e)).left+n}function Qi(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-lo(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Lc(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",a=Mn(o),l=t?Yt(t.floating):!1;if(o===a||l&&s)return n;let d={scrollLeft:0,scrollTop:0},u=Nn(1);const _=Nn(0),p=Je(o);if((p||!p&&!s)&&((Gn(o)!=="body"||It(a))&&(d=Jt(o)),Je(o))){const c=rt(o);u=ht(o),_.x=c.x+o.clientLeft,_.y=c.y+o.clientTop}const f=a&&!p&&!s?Qi(a,d):Nn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-d.scrollLeft*u.x+_.x+f.x,y:n.y*u.y-d.scrollTop*u.y+_.y+f.y}}function Dc(e){return Array.from(e.getClientRects())}function zc(e){const t=Mn(e),n=Jt(e),o=e.ownerDocument.body,r=yn(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=yn(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+lo(e);const l=-n.scrollTop;return wn(o).direction==="rtl"&&(a+=yn(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:a,y:l}}const Ri=25;function Pc(e,t){const n=vn(e),o=Mn(e),r=n.visualViewport;let s=o.clientWidth,a=o.clientHeight,l=0,d=0;if(r){s=r.width,a=r.height;const _=Zt();(!_||_&&t==="fixed")&&(l=r.offsetLeft,d=r.offsetTop)}const u=lo(o);if(u<=0){const _=o.ownerDocument,p=_.body,f=getComputedStyle(p),c=_.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,h=Math.abs(o.clientWidth-p.clientWidth-c);h<=Ri&&(s-=h)}else u<=Ri&&(s+=u);return{width:s,height:a,x:l,y:d}}const Tc=new Set(["absolute","fixed"]);function Oc(e,t){const n=rt(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=Je(e)?ht(e):Nn(1),a=e.clientWidth*s.x,l=e.clientHeight*s.y,d=r*s.x,u=o*s.y;return{width:a,height:l,x:d,y:u}}function es(e,t,n){let o;if(t==="viewport")o=Pc(e,n);else if(t==="document")o=zc(Mn(e));else if(Oe(t))o=Oc(t,n);else{const r=Ji(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return eo(o)}function ns(e,t){const n=Tn(e);return n===t||!Oe(n)||Pn(n)?!1:wn(n).position==="fixed"||ns(n,t)}function Vc(e,t){const n=t.get(e);if(n)return n;let o=Wn(e,[],!1).filter(l=>Oe(l)&&Gn(l)!=="body"),r=null;const s=wn(e).position==="fixed";let a=s?Tn(e):e;for(;Oe(a)&&!Pn(a);){const l=wn(a),d=Jo(a);!d&&l.position==="fixed"&&(r=null),(s?!d&&!r:!d&&l.position==="static"&&!!r&&Tc.has(r.position)||It(a)&&!d&&ns(e,a))?o=o.filter(_=>_!==a):r=l,a=Tn(a)}return t.set(e,o),o}function qc(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[...n==="clippingAncestors"?Yt(t)?[]:Vc(t,this._c):[].concat(n),o],l=a[0],d=a.reduce((u,_)=>{const p=es(t,_,r);return u.top=yn(p.top,u.top),u.right=Kn(p.right,u.right),u.bottom=Kn(p.bottom,u.bottom),u.left=yn(p.left,u.left),u},es(t,l,r));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function jc(e){const{width:t,height:n}=Zi(e);return{width:t,height:n}}function Bc(e,t,n){const o=Je(t),r=Mn(t),s=n==="fixed",a=rt(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const d=Nn(0);function u(){d.x=lo(r)}if(o||!o&&!s)if((Gn(t)!=="body"||It(r))&&(l=Jt(t)),o){const c=rt(t,!0,s,t);d.x=c.x+t.clientLeft,d.y=c.y+t.clientTop}else r&&u();s&&!o&&r&&u();const _=r&&!o&&!s?Qi(r,l):Nn(0),p=a.left+l.scrollLeft-d.x-_.x,f=a.top+l.scrollTop-d.y-_.y;return{x:p,y:f,width:a.width,height:a.height}}function gr(e){return wn(e).position==="static"}function ts(e,t){if(!Je(e)||wn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Mn(e)===n&&(n=n.ownerDocument.body),n}function os(e,t){const n=vn(e);if(Yt(e))return n;if(!Je(e)){let r=Tn(e);for(;r&&!Pn(r);){if(Oe(r)&&!gr(r))return r;r=Tn(r)}return n}let o=ts(e,t);for(;o&&El(o)&&gr(o);)o=ts(o,t);return o&&Pn(o)&&gr(o)&&!Jo(o)?n:o||Ll(e)||n}const Hc=async function(e){const t=this.getOffsetParent||os,n=this.getDimensions,o=await n(e.floating);return{reference:Bc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Gc(e){return wn(e).direction==="rtl"}const Wc={convertOffsetParentRelativeRectToViewportRelativeRect:Lc,getDocumentElement:Mn,getClippingRect:qc,getOffsetParent:os,getElementRects:Hc,getClientRects:Dc,getDimensions:jc,getScale:ht,isElement:Oe,isRTL:Gc};function rs(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Kc(e,t){let n=null,o;const r=Mn(e);function s(){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),s();const u=e.getBoundingClientRect(),{left:_,top:p,width:f,height:c}=u;if(l||t(),!f||!c)return;const h=ft(p),g=ft(r.clientWidth-(_+f)),v=ft(r.clientHeight-(p+c)),w=ft(_),x={rootMargin:-h+"px "+-g+"px "+-v+"px "+-w+"px",threshold:yn(0,Kn(1,d))||1};let k=!0;function L(A){const M=A[0].intersectionRatio;if(M!==d){if(!k)return a();M?a(!1,M):o=setTimeout(()=>{a(!1,1e-7)},1e3)}M===1&&!rs(u,e.getBoundingClientRect())&&a(),k=!1}try{n=new IntersectionObserver(L,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(L,x)}n.observe(e)}return a(!0),s}function co(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,u=_r(e),_=r||s?[...u?Wn(u):[],...Wn(t)]:[];_.forEach(w=>{r&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const p=u&&l?Kc(u,n):null;let f=-1,c=null;a&&(c=new ResizeObserver(w=>{let[y]=w;y&&y.target===u&&c&&(c.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=c)==null||x.observe(t)})),n()}),u&&!d&&c.observe(u),c.observe(t));let h,g=d?rt(e):null;d&&v();function v(){const w=rt(e);g&&!rs(g,w)&&n(),g=w,h=requestAnimationFrame(v)}return n(),()=>{var w;_.forEach(y=>{r&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),p?.(),(w=c)==null||w.disconnect(),c=null,d&&cancelAnimationFrame(h)}}const Uc=Ec,Xc=Mc,Yc=Sc,Zc=Nc,is=$c,Jc=(e,t,n)=>{const o=new Map,r={platform:Wc,...n},s={...r.platform,_c:o};return xc(e,t,{...r,platform:s})};var Qc=typeof document<"u",Rc=function(){},uo=Qc?m.useLayoutEffect:Rc;function fo(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(!fo(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 s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!fo(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ss(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function as(e,t){const n=ss(e);return Math.round(t*n)/n}function pr(e){const t=E.useRef(e);return uo(()=>{t.current=e}),t}function ed(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:a}={},transform:l=!0,whileElementsMounted:d,open:u}=e,[_,p]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,c]=E.useState(o);fo(f,o)||c(o);const[h,g]=E.useState(null),[v,w]=E.useState(null),y=E.useCallback(C=>{C!==A.current&&(A.current=C,g(C))},[]),x=E.useCallback(C=>{C!==M.current&&(M.current=C,w(C))},[]),k=s||h,L=a||v,A=E.useRef(null),M=E.useRef(null),T=E.useRef(_),P=d!=null,I=pr(d),q=pr(r),V=pr(u),S=E.useCallback(()=>{if(!A.current||!M.current)return;const C={placement:t,strategy:n,middleware:f};q.current&&(C.platform=q.current),Jc(A.current,M.current,C).then(z=>{const O={...z,isPositioned:V.current!==!1};b.current&&!fo(T.current,O)&&(T.current=O,Ho.flushSync(()=>{p(O)}))})},[f,t,n,q,V]);uo(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,p(C=>({...C,isPositioned:!1})))},[u]);const b=E.useRef(!1);uo(()=>(b.current=!0,()=>{b.current=!1}),[]),uo(()=>{if(k&&(A.current=k),L&&(M.current=L),k&&L){if(I.current)return I.current(k,L,S);S()}},[k,L,S,I,P]);const $=E.useMemo(()=>({reference:A,floating:M,setReference:y,setFloating:x}),[y,x]),D=E.useMemo(()=>({reference:k,floating:L}),[k,L]),N=E.useMemo(()=>{const C={position:n,left:0,top:0};if(!D.floating)return C;const z=as(D.floating,_.x),O=as(D.floating,_.y);return l?{...C,transform:"translate("+z+"px, "+O+"px)",...ss(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:O}},[n,l,D.floating,_.x,_.y]);return E.useMemo(()=>({..._,update:S,refs:$,elements:D,floatingStyles:N}),[_,S,$,D,N])}const nd=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?is({element:o.current,padding:r}).fn(n):{}:o?is({element:o,padding:r}).fn(n):{}}}},_o=(e,t)=>({...Uc(e),options:[e,t]}),go=(e,t)=>({...Xc(e),options:[e,t]}),po=(e,t)=>({...Yc(e),options:[e,t]}),ls=(e,t)=>({...Zc(e),options:[e,t]}),td=(e,t)=>({...nd(e),options:[e,t]});function cs(e){const t=E.useRef(void 0),n=E.useCallback(o=>{const r=e.map(s=>{if(s!=null){if(typeof s=="function"){const a=s,l=a(o);return typeof l=="function"?l:()=>{a(null)}}return s.current=o,()=>{s.current=null}}});return()=>{r.forEach(s=>s?.())}},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 od="data-floating-ui-focusable",ds="active",us="selected",Lt="ArrowLeft",Dt="ArrowRight",fs="ArrowUp",ho="ArrowDown",rd={...E};let _s=!1,id=0;const gs=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+id++;function sd(){const[e,t]=E.useState(()=>_s?gs():void 0);return Ve(()=>{e==null&&t(gs())},[]),E.useEffect(()=>{_s=!0},[]),e}const zt=rd.useId||sd;let Pt;process.env.NODE_ENV!=="production"&&(Pt=new Set);function mo(){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=Pt)!=null&&e.has(r))){var s;(s=Pt)==null||s.add(r),console.warn(r)}}function ad(){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=Pt)!=null&&e.has(r))){var s;(s=Pt)==null||s.add(r),console.error(r)}}const ld=E.forwardRef(function(t,n){const{context:{placement:o,elements:{floating:r},middlewareData:{arrow:s,shift:a}},width:l=14,height:d=7,tipRadius:u=0,strokeWidth:_=0,staticOffset:p,stroke:f,d:c,style:{transform:h,...g}={},...v}=t;process.env.NODE_ENV!=="production"&&(n||mo("The `ref` prop is required for `FloatingArrow`."));const w=zt(),[y,x]=E.useState(!1);if(Ve(()=>{if(!r)return;wn(r).direction==="rtl"&&x(!0)},[r]),!r)return null;const[k,L]=o.split("-"),A=k==="top"||k==="bottom";let M=p;(A&&a!=null&&a.x||!A&&a!=null&&a.y)&&(M=null);const T=_*2,P=T/2,I=l/2*(u/-8+1),q=d/2*u/4,V=!!c,S=M&&L==="end"?"bottom":"top";let b=M&&L==="end"?"right":"left";M&&y&&(b=L==="end"?"left":"right");const $=s?.x!=null?M||s.x:"",D=s?.y!=null?M||s.y:"",N=c||"M0,0"+(" H"+l)+(" L"+(l-I)+","+(d-q))+(" Q"+l/2+","+d+" "+I+","+(d-q))+" Z",C={top:V?"rotate(180deg)":"",left:V?"rotate(90deg)":"rotate(-90deg)",bottom:V?"":"rotate(180deg)",right:V?"rotate(-90deg)":"rotate(90deg)"}[k];return i.jsxs("svg",{...v,"aria-hidden":!0,ref:n,width:V?l:l+T,height:l,viewBox:"0 0 "+l+" "+(d>l?d:l),style:{position:"absolute",pointerEvents:"none",[b]:$,[S]:D,[k]:A||V?"100%":"calc(100% - "+T/2+"px)",transform:[C,h].filter(z=>!!z).join(" "),...g},children:[T>0&&i.jsx("path",{clipPath:"url(#"+w+")",fill:"none",stroke:f,strokeWidth:T+(c?0:1),d:N}),i.jsx("path",{stroke:T&&!c?v.fill:"none",d:N}),i.jsx("clipPath",{id:w,children:i.jsx("rect",{x:-P,y:P*(V?-1:1),width:l+T,height:l})})]})});function ps(){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 hs=E.createContext(null),ms=E.createContext(null),mt=()=>{var e;return((e=E.useContext(hs))==null?void 0:e.id)||null},it=()=>E.useContext(ms);function vs(e){const t=zt(),n=it(),r=mt();return Ve(()=>{if(!t)return;const s={id:t,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,t,r]),t}function bs(e){const{children:t,id:n}=e,o=mt();return i.jsx(hs.Provider,{value:E.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function cd(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)},[]),[s]=E.useState(()=>ps());return i.jsx(ms.Provider,{value:E.useMemo(()=>({nodesRef:n,addNode:o,removeNode:r,events:s}),[o,r,s]),children:t})}function st(e){return"data-floating-ui-"+e}function un(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const ws=st("safe-polygon");function hr(e,t,n){if(n&&!Mt(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 mr(e){return typeof e=="function"?e():e}function vr(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,events:s,elements:a}=e,{enabled:l=!0,delay:d=0,handleClose:u=null,mouseOnly:_=!1,restMs:p=0,move:f=!0}=t,c=it(),h=mt(),g=an(u),v=an(d),w=an(n),y=an(p),x=E.useRef(),k=E.useRef(-1),L=E.useRef(),A=E.useRef(-1),M=E.useRef(!0),T=E.useRef(!1),P=E.useRef(()=>{}),I=E.useRef(!1),q=Qe(()=>{var N;const C=(N=r.current.openEvent)==null?void 0:N.type;return C?.includes("mouse")&&C!=="mousedown"});E.useEffect(()=>{if(!l)return;function N(C){let{open:z}=C;z||(un(k),un(A),M.current=!0,I.current=!1)}return s.on("openchange",N),()=>{s.off("openchange",N)}},[l,s]),E.useEffect(()=>{if(!l||!g.current||!n)return;function N(z){q()&&o(!1,z,"hover")}const C=cn(a.floating).documentElement;return C.addEventListener("mouseleave",N),()=>{C.removeEventListener("mouseleave",N)}},[a.floating,n,o,l,g,q]);const V=E.useCallback(function(N,C,z){C===void 0&&(C=!0),z===void 0&&(z="hover");const O=hr(v.current,"close",x.current);O&&!L.current?(un(k),k.current=window.setTimeout(()=>o(!1,N,z),O)):C&&(un(k),o(!1,N,z))},[v,o]),S=Qe(()=>{P.current(),L.current=void 0}),b=Qe(()=>{if(T.current){const N=cn(a.floating).body;N.style.pointerEvents="",N.removeAttribute(ws),T.current=!1}}),$=Qe(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);E.useEffect(()=>{if(!l)return;function N(G){if(un(k),M.current=!1,_&&!Mt(x.current)||mr(y.current)>0&&!hr(v.current,"open"))return;const F=hr(v.current,"open",x.current);F?k.current=window.setTimeout(()=>{w.current||o(!0,G,"hover")},F):n||o(!0,G,"hover")}function C(G){if($()){b();return}P.current();const F=cn(a.floating);if(un(A),I.current=!1,g.current&&r.current.floatingContext){n||un(k),L.current=g.current({...r.current.floatingContext,tree:c,x:G.clientX,y:G.clientY,onClose(){b(),S(),$()||V(G,!0,"safe-polygon")}});const B=L.current;F.addEventListener("mousemove",B),P.current=()=>{F.removeEventListener("mousemove",B)};return}(x.current==="touch"?!ln(a.floating,G.relatedTarget):!0)&&V(G)}function z(G){$()||r.current.floatingContext&&(g.current==null||g.current({...r.current.floatingContext,tree:c,x:G.clientX,y:G.clientY,onClose(){b(),S(),$()||V(G)}})(G))}function O(){un(k)}function W(G){$()||V(G,!1)}if(Oe(a.domReference)){const G=a.domReference,F=a.floating;return n&&G.addEventListener("mouseleave",z),f&&G.addEventListener("mousemove",N,{once:!0}),G.addEventListener("mouseenter",N),G.addEventListener("mouseleave",C),F&&(F.addEventListener("mouseleave",z),F.addEventListener("mouseenter",O),F.addEventListener("mouseleave",W)),()=>{n&&G.removeEventListener("mouseleave",z),f&&G.removeEventListener("mousemove",N),G.removeEventListener("mouseenter",N),G.removeEventListener("mouseleave",C),F&&(F.removeEventListener("mouseleave",z),F.removeEventListener("mouseenter",O),F.removeEventListener("mouseleave",W))}}},[a,l,e,_,f,V,S,b,o,n,w,c,v,g,r,$,y]),Ve(()=>{var N;if(l&&n&&(N=g.current)!=null&&(N=N.__options)!=null&&N.blockPointerEvents&&q()){T.current=!0;const z=a.floating;if(Oe(a.domReference)&&z){var C;const O=cn(a.floating).body;O.setAttribute(ws,"");const W=a.domReference,G=c==null||(C=c.nodesRef.current.find(F=>F.id===h))==null||(C=C.context)==null?void 0:C.elements.floating;return G&&(G.style.pointerEvents=""),O.style.pointerEvents="none",W.style.pointerEvents="auto",z.style.pointerEvents="auto",()=>{O.style.pointerEvents="",W.style.pointerEvents="",z.style.pointerEvents=""}}}},[l,n,h,a,c,g,q]),Ve(()=>{n||(x.current=void 0,I.current=!1,S(),b())},[n,S,b]),E.useEffect(()=>()=>{S(),un(k),un(A),b()},[l,a.domReference,S,b]);const D=E.useMemo(()=>{function N(C){x.current=C.pointerType}return{onPointerDown:N,onPointerEnter:N,onMouseMove(C){const{nativeEvent:z}=C;function O(){!M.current&&!w.current&&o(!0,z,"hover")}_&&!Mt(x.current)||n||mr(y.current)===0||I.current&&C.movementX**2+C.movementY**2<2||(un(A),x.current==="touch"?O():(I.current=!0,A.current=window.setTimeout(O,mr(y.current))))}}},[_,o,n,w,y]);return E.useMemo(()=>l?{reference:D}:{},[l,D])}let ys=0;function at(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(ys);const s=()=>e?.focus({preventScroll:n});r?s():ys=requestAnimationFrame(s)}function br(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Xt(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function dd(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ud(e){return e?.ownerDocument||document}const vt={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Cs(e){return e==="inert"?vt.inert:e==="aria-hidden"?vt["aria-hidden"]:vt.none}let vo=new WeakSet,bo={},wr=0;const fd=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,xs=e=>e&&(e.host||xs(e.parentNode)),_d=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=xs(n);return e.contains(o)?o:null}).filter(n=>n!=null);function gd(e,t,n,o){const r="data-floating-ui-inert",s=o?"inert":n?"aria-hidden":null,a=_d(t,e),l=new Set,d=new Set(a),u=[];bo[r]||(bo[r]=new WeakMap);const _=bo[r];a.forEach(p),f(t),l.clear();function p(c){!c||l.has(c)||(l.add(c),c.parentNode&&p(c.parentNode))}function f(c){!c||d.has(c)||[].forEach.call(c.children,h=>{if(Gn(h)!=="script")if(l.has(h))f(h);else{const g=s?h.getAttribute(s):null,v=g!==null&&g!=="false",w=Cs(s),y=(w.get(h)||0)+1,x=(_.get(h)||0)+1;w.set(h,y),_.set(h,x),u.push(h),y===1&&v&&vo.add(h),x===1&&h.setAttribute(r,""),!v&&s&&h.setAttribute(s,s==="inert"?"":"true")}})}return wr++,()=>{u.forEach(c=>{const h=Cs(s),v=(h.get(c)||0)-1,w=(_.get(c)||0)-1;h.set(c,v),_.set(c,w),v||(!vo.has(c)&&s&&c.removeAttribute(s),vo.delete(c)),w||c.removeAttribute(r)}),wr--,wr||(vt.inert=new WeakMap,vt["aria-hidden"]=new WeakMap,vt.none=new WeakMap,vo=new WeakSet,bo={})}}function $s(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=ud(e[0]).body;return gd(e.concat(Array.from(o.querySelectorAll('[aria-live],[role="status"],output'))),o,t,n)}const wo={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},yo=E.forwardRef(function(t,n){const[o,r]=E.useState();Ve(()=>{Oi()&&r("button")},[]);const s={ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[st("focus-guard")]:"",style:wo};return i.jsx("span",{...t,...s})}),Ss=E.createContext(null),ks=st("portal");function pd(e){e===void 0&&(e={});const{id:t,root:n}=e,o=zt(),r=Is(),[s,a]=E.useState(null),l=E.useRef(null);return Ve(()=>()=>{s?.remove(),queueMicrotask(()=>{l.current=null})},[s]),Ve(()=>{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(ks,""),d.appendChild(u),l.current=u,a(u)},[t,o]),Ve(()=>{if(n===null||!o||l.current)return;let d=n||r?.portalNode;d&&!Zo(d)&&(d=d.current),d=d||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,d.appendChild(u));const _=document.createElement("div");_.id=o,_.setAttribute(ks,""),d=u||d,d.appendChild(_),l.current=_,a(_)},[t,n,o,r]),s}function Co(e){const{children:t,id:n,root:o,preserveTabOrder:r=!0}=e,s=pd({id:n,root:o}),[a,l]=E.useState(null),d=E.useRef(null),u=E.useRef(null),_=E.useRef(null),p=E.useRef(null),f=a?.modal,c=a?.open,h=!!a&&!a.modal&&a.open&&r&&!!(o||s);return E.useEffect(()=>{if(!s||!r||f)return;function g(v){s&&At(v)&&(v.type==="focusin"?Xi:Cc)(s)}return s.addEventListener("focusin",g,!0),s.addEventListener("focusout",g,!0),()=>{s.removeEventListener("focusin",g,!0),s.removeEventListener("focusout",g,!0)}},[s,r,f]),E.useEffect(()=>{s&&(c||Xi(s))},[c,s]),i.jsxs(Ss.Provider,{value:E.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:d,afterOutsideRef:u,beforeInsideRef:_,afterInsideRef:p,portalNode:s,setFocusManagerState:l}),[r,s]),children:[h&&s&&i.jsx(yo,{"data-type":"outside",ref:d,onFocus:g=>{if(At(g,s)){var v;(v=_.current)==null||v.focus()}else{const w=a?a.domReference:null,y=Ui(w);y?.focus()}}}),h&&s&&i.jsx("span",{"aria-owns":s.id,style:wo}),s&&Ho.createPortal(t,s),h&&s&&i.jsx(yo,{"data-type":"outside",ref:u,onFocus:g=>{if(At(g,s)){var v;(v=p.current)==null||v.focus()}else{const w=a?a.domReference:null,y=Ki(w);y?.focus(),a?.closeOnFocusOut&&a?.onOpenChange(!1,g.nativeEvent,"focus-out")}}})]})}const Is=()=>E.useContext(Ss);function Es(e){return E.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const hd=20;let Xn=[];function yr(){Xn=Xn.filter(e=>e.isConnected)}function md(e){yr(),e&&Gn(e)!=="body"&&(Xn.push(e),Xn.length>hd&&(Xn=Xn.slice(-20)))}function Ms(){return yr(),Xn[Xn.length-1]}function vd(e){const t=Ft();return zi(e,t)?e:ro(e,t)[0]||e}function Ns(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;const o=Ft(),s=ic(e,o).filter(l=>{const d=l.getAttribute("data-tabindex")||"";return zi(l,o)||l.hasAttribute("data-tabindex")&&!d.startsWith("-")}),a=e.getAttribute("tabindex");t.current.includes("floating")||s.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 bd=E.forwardRef(function(t,n){return i.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:wo})});function Cr(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],guards:s=!0,initialFocus:a=0,returnFocus:l=!0,restoreFocus:d=!1,modal:u=!0,visuallyHiddenDismiss:_=!1,closeOnFocusOut:p=!0,outsideElementsInert:f=!1,getInsideElements:c=()=>[]}=e,{open:h,onOpenChange:g,events:v,dataRef:w,elements:{domReference:y,floating:x}}=t,k=Qe(()=>{var Q;return(Q=w.current.floatingContext)==null?void 0:Q.nodeId}),L=Qe(c),A=typeof a=="number"&&a<0,M=dr(y)&&A,T=fd(),P=T?s:!0,I=!P||T&&f,q=an(r),V=an(a),S=an(l),b=it(),$=Is(),D=E.useRef(null),N=E.useRef(null),C=E.useRef(!1),z=E.useRef(!1),O=E.useRef(-1),W=E.useRef(-1),G=$!=null,F=io(x),j=Qe(function(Q){return Q===void 0&&(Q=F),Q?ro(Q,Ft()):[]}),B=Qe(Q=>{const se=j(Q);return q.current.map(re=>y&&re==="reference"?y:F&&re==="floating"?F:se).filter(Boolean).flat()});E.useEffect(()=>{if(o||!u)return;function Q(re){if(re.key==="Tab"){ln(F,Fn(cn(F)))&&j().length===0&&!M&&dn(re);const be=B(),le=Vn(re);q.current[0]==="reference"&&le===y&&(dn(re),re.shiftKey?at(be[be.length-1]):at(be[1])),q.current[1]==="floating"&&le===F&&re.shiftKey&&(dn(re),at(be[0]))}}const se=cn(F);return se.addEventListener("keydown",Q),()=>{se.removeEventListener("keydown",Q)}},[o,y,F,u,q,M,j,B]),E.useEffect(()=>{if(o||!x)return;function Q(se){const re=Vn(se),le=j().indexOf(re);le!==-1&&(O.current=le)}return x.addEventListener("focusin",Q),()=>{x.removeEventListener("focusin",Q)}},[o,x,j]),E.useEffect(()=>{if(o||!p)return;function Q(){z.current=!0,setTimeout(()=>{z.current=!1})}function se(le){const ne=le.relatedTarget,ue=le.currentTarget,we=Vn(le);queueMicrotask(()=>{const oe=k(),ye=!(ln(y,ne)||ln(x,ne)||ln(ne,x)||ln($?.portalNode,ne)||ne!=null&&ne.hasAttribute(st("focus-guard"))||b&&(ot(b.nodesRef.current,oe).find(U=>{var H,K;return ln((H=U.context)==null?void 0:H.elements.floating,ne)||ln((K=U.context)==null?void 0:K.elements.domReference,ne)})||ji(b.nodesRef.current,oe).find(U=>{var H,K,ie;return[(H=U.context)==null?void 0:H.elements.floating,io((K=U.context)==null?void 0:K.elements.floating)].includes(ne)||((ie=U.context)==null?void 0:ie.elements.domReference)===ne})));if(ue===y&&F&&Ns(F,q),d&&ue!==y&&!(we!=null&&we.isConnected)&&Fn(cn(F))===cn(F).body){Je(F)&&F.focus();const U=O.current,H=j(),K=H[U]||H[H.length-1]||F;Je(K)&&K.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(M||!u)&&ne&&ye&&!z.current&&ne!==Ms()&&(C.current=!0,g(!1,le,"focus-out"))})}const re=!!(!b&&$);function be(){un(W),w.current.insideReactTree=!0,W.current=window.setTimeout(()=>{w.current.insideReactTree=!1})}if(x&&Je(y))return y.addEventListener("focusout",se),y.addEventListener("pointerdown",Q),x.addEventListener("focusout",se),re&&x.addEventListener("focusout",be,!0),()=>{y.removeEventListener("focusout",se),y.removeEventListener("pointerdown",Q),x.removeEventListener("focusout",se),re&&x.removeEventListener("focusout",be,!0)}},[o,y,x,F,u,b,$,g,p,d,j,M,k,q,w]);const te=E.useRef(null),Z=E.useRef(null),R=Es([te,$?.beforeInsideRef]),ge=Es([Z,$?.afterInsideRef]);E.useEffect(()=>{var Q,se;if(o||!x)return;const re=Array.from(($==null||(Q=$.portalNode)==null?void 0:Q.querySelectorAll("["+st("portal")+"]"))||[]),le=(se=(b?ji(b.nodesRef.current,k()):[]).find(we=>{var oe;return dr(((oe=we.context)==null?void 0:oe.elements.domReference)||null)}))==null||(se=se.context)==null?void 0:se.elements.domReference,ne=[x,le,...re,...L(),D.current,N.current,te.current,Z.current,$?.beforeOutsideRef.current,$?.afterOutsideRef.current,q.current.includes("reference")||M?y:null].filter(we=>we!=null),ue=u||M?$s(ne,!I,I):$s(ne);return()=>{ue()}},[o,y,x,u,q,$,M,P,I,b,k,L]),Ve(()=>{if(o||!Je(F))return;const Q=cn(F),se=Fn(Q);queueMicrotask(()=>{const re=B(F),be=V.current,le=(typeof be=="number"?re[be]:be.current)||F,ne=ln(F,se);!A&&!ne&&h&&at(le,{preventScroll:le===F})})},[o,h,F,A,B,V]),Ve(()=>{if(o||!F)return;const Q=cn(F),se=Fn(Q);md(se);function re(ne){let{reason:ue,event:we,nested:oe}=ne;if(["hover","safe-polygon"].includes(ue)&&we.type==="mouseleave"&&(C.current=!0),ue==="outside-press")if(oe)C.current=!1;else if(Bi(we)||Hi(we))C.current=!1;else{let ye=!1;document.createElement("div").focus({get preventScroll(){return ye=!0,!1}}),ye?C.current=!1:C.current=!0}}v.on("openchange",re);const be=Q.createElement("span");be.setAttribute("tabindex","-1"),be.setAttribute("aria-hidden","true"),Object.assign(be.style,wo),G&&y&&y.insertAdjacentElement("afterend",be);function le(){if(typeof S.current=="boolean"){const ne=y||Ms();return ne&&ne.isConnected?ne:be}return S.current.current||be}return()=>{v.off("openchange",re);const ne=Fn(Q),ue=ln(x,ne)||b&&ot(b.nodesRef.current,k(),!1).some(oe=>{var ye;return ln((ye=oe.context)==null?void 0:ye.elements.floating,ne)}),we=le();queueMicrotask(()=>{const oe=vd(we);S.current&&!C.current&&Je(oe)&&(!(oe!==ne&&ne!==Q.body)||ue)&&oe.focus({preventScroll:!0}),be.remove()})}},[o,x,F,S,w,v,b,G,y,k]),E.useEffect(()=>(queueMicrotask(()=>{C.current=!1}),()=>{queueMicrotask(yr)}),[o]),Ve(()=>{if(!o&&$)return $.setFocusManagerState({modal:u,closeOnFocusOut:p,open:h,onOpenChange:g,domReference:y}),()=>{$.setFocusManagerState(null)}},[o,$,u,h,g,p,y]),Ve(()=>{o||F&&Ns(F,q)},[o,F,q]);function fe(Q){return o||!_||!u?null:i.jsx(bd,{ref:Q==="start"?D:N,onClick:se=>g(!1,se.nativeEvent),children:typeof _=="string"?_:"Dismiss"})}const Ce=!o&&P&&(u?!M:!0)&&(G||u);return i.jsxs(i.Fragment,{children:[Ce&&i.jsx(yo,{"data-type":"inside",ref:R,onFocus:Q=>{if(u){const re=B();at(r[0]==="reference"?re[0]:re[re.length-1])}else if($!=null&&$.preserveTabOrder&&$.portalNode)if(C.current=!1,At(Q,$.portalNode)){const re=Ki(y);re?.focus()}else{var se;(se=$.beforeOutsideRef.current)==null||se.focus()}}}),!M&&fe("start"),n,fe("end"),Ce&&i.jsx(yo,{"data-type":"inside",ref:ge,onFocus:Q=>{if(u)at(B()[0]);else if($!=null&&$.preserveTabOrder&&$.portalNode)if(p&&(C.current=!0),At(Q,$.portalNode)){const re=Ui(y);re?.focus()}else{var se;(se=$.afterOutsideRef.current)==null||se.focus()}}})]})}function Fs(e){return Je(e.target)&&e.target.tagName==="BUTTON"}function wd(e){return Je(e.target)&&e.target.tagName==="A"}function As(e){return cr(e)}function Ls(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,elements:{domReference:s}}=e,{enabled:a=!0,event:l="click",toggle:d=!0,ignoreMouse:u=!1,keyboardHandlers:_=!0,stickIfOpen:p=!0}=t,f=E.useRef(),c=E.useRef(!1),h=E.useMemo(()=>({onPointerDown(g){f.current=g.pointerType},onMouseDown(g){const v=f.current;g.button===0&&l!=="click"&&(Mt(v,!0)&&u||(n&&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 v=f.current;if(l==="mousedown"&&f.current){f.current=void 0;return}Mt(v,!0)&&u||(n&&d&&(!(r.current.openEvent&&p)||r.current.openEvent.type==="click")?o(!1,g.nativeEvent,"click"):o(!0,g.nativeEvent,"click"))},onKeyDown(g){f.current=void 0,!(g.defaultPrevented||!_||Fs(g))&&(g.key===" "&&!As(s)&&(g.preventDefault(),c.current=!0),!wd(g)&&g.key==="Enter"&&o(!(n&&d),g.nativeEvent,"click"))},onKeyUp(g){g.defaultPrevented||!_||Fs(g)||As(s)||g.key===" "&&c.current&&(c.current=!1,o(!(n&&d),g.nativeEvent,"click"))}}),[r,s,l,u,_,o,n,p,d]);return E.useMemo(()=>a?{reference:h}:{},[a,h])}const yd={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Cd={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ds=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 xo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,elements:r,dataRef:s}=e,{enabled:a=!0,escapeKey:l=!0,outsidePress:d=!0,outsidePressEvent:u="pointerdown",referencePress:_=!1,referencePressEvent:p="pointerdown",ancestorScroll:f=!1,bubbles:c,capture:h}=t,g=it(),v=Qe(typeof d=="function"?d:()=>!1),w=typeof d=="function"?v:d,y=E.useRef(!1),{escapeKey:x,outsidePress:k}=Ds(c),{escapeKey:L,outsidePress:A}=Ds(h),M=E.useRef(!1),T=Qe(b=>{var $;if(!n||!a||!l||b.key!=="Escape"||M.current)return;const D=($=s.current.floatingContext)==null?void 0:$.nodeId,N=g?ot(g.nodesRef.current,D):[];if(!x&&(b.stopPropagation(),N.length>0)){let C=!0;if(N.forEach(z=>{var O;if((O=z.context)!=null&&O.open&&!z.context.dataRef.current.__escapeKeyBubbles){C=!1;return}}),!C)return}o(!1,_c(b)?b.nativeEvent:b,"escape-key")}),P=Qe(b=>{var $;const D=()=>{var N;T(b),(N=Vn(b))==null||N.removeEventListener("keydown",D)};($=Vn(b))==null||$.addEventListener("keydown",D)}),I=Qe(b=>{var $;const D=s.current.insideReactTree;s.current.insideReactTree=!1;const N=y.current;if(y.current=!1,u==="click"&&N||D||typeof w=="function"&&!w(b))return;const C=Vn(b),z="["+st("inert")+"]",O=cn(r.floating).querySelectorAll(z);let W=Oe(C)?C:null;for(;W&&!Pn(W);){const B=Tn(W);if(Pn(B)||!Oe(B))break;W=B}if(O.length&&Oe(C)&&!dc(C)&&!ln(C,r.floating)&&Array.from(O).every(B=>!ln(W,B)))return;if(Je(C)&&S){const B=Pn(C),te=wn(C),Z=/auto|scroll/,R=B||Z.test(te.overflowX),ge=B||Z.test(te.overflowY),fe=R&&C.clientWidth>0&&C.scrollWidth>C.clientWidth,Ce=ge&&C.clientHeight>0&&C.scrollHeight>C.clientHeight,Q=te.direction==="rtl",se=Ce&&(Q?b.offsetX<=C.offsetWidth-C.clientWidth:b.offsetX>C.clientWidth),re=fe&&b.offsetY>C.clientHeight;if(se||re)return}const G=($=s.current.floatingContext)==null?void 0:$.nodeId,F=g&&ot(g.nodesRef.current,G).some(B=>{var te;return lr(b,(te=B.context)==null?void 0:te.elements.floating)});if(lr(b,r.floating)||lr(b,r.domReference)||F)return;const j=g?ot(g.nodesRef.current,G):[];if(j.length>0){let B=!0;if(j.forEach(te=>{var Z;if((Z=te.context)!=null&&Z.open&&!te.context.dataRef.current.__outsidePressBubbles){B=!1;return}}),!B)return}o(!1,b,"outside-press")}),q=Qe(b=>{var $;const D=()=>{var N;I(b),(N=Vn(b))==null||N.removeEventListener(u,D)};($=Vn(b))==null||$.addEventListener(u,D)});E.useEffect(()=>{if(!n||!a)return;s.current.__escapeKeyBubbles=x,s.current.__outsidePressBubbles=k;let b=-1;function $(O){o(!1,O,"ancestor-scroll")}function D(){window.clearTimeout(b),M.current=!0}function N(){b=window.setTimeout(()=>{M.current=!1},Zt()?5:0)}const C=cn(r.floating);l&&(C.addEventListener("keydown",L?P:T,L),C.addEventListener("compositionstart",D),C.addEventListener("compositionend",N)),w&&C.addEventListener(u,A?q:I,A);let z=[];return f&&(Oe(r.domReference)&&(z=Wn(r.domReference)),Oe(r.floating)&&(z=z.concat(Wn(r.floating))),!Oe(r.reference)&&r.reference&&r.reference.contextElement&&(z=z.concat(Wn(r.reference.contextElement)))),z=z.filter(O=>{var W;return O!==((W=C.defaultView)==null?void 0:W.visualViewport)}),z.forEach(O=>{O.addEventListener("scroll",$,{passive:!0})}),()=>{l&&(C.removeEventListener("keydown",L?P:T,L),C.removeEventListener("compositionstart",D),C.removeEventListener("compositionend",N)),w&&C.removeEventListener(u,A?q:I,A),z.forEach(O=>{O.removeEventListener("scroll",$)}),window.clearTimeout(b)}},[s,r,l,w,u,n,o,f,a,x,k,T,L,P,I,A,q]),E.useEffect(()=>{s.current.insideReactTree=!1},[s,w,u]);const V=E.useMemo(()=>({onKeyDown:T,..._&&{[yd[p]]:b=>{o(!1,b.nativeEvent,"reference-press")},...p!=="click"&&{onClick(b){o(!1,b.nativeEvent,"reference-press")}}}}),[T,o,_,p]),S=E.useMemo(()=>({onKeyDown:T,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[Cd[u]]:()=>{s.current.insideReactTree=!0}}),[T,u,s]);return E.useMemo(()=>a?{reference:V,floating:S}:{},[a,V,S])}function xd(e){const{open:t=!1,onOpenChange:n,elements:o}=e,r=zt(),s=E.useRef({}),[a]=E.useState(()=>ps()),l=mt()!=null;if(process.env.NODE_ENV!=="production"){const c=o.reference;c&&!Oe(c)&&ad("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),_=Qe((c,h,g)=>{s.current.openEvent=c?h:void 0,a.emit("openchange",{open:c,event:h,reason:g,nested:l}),n?.(c,h,g)}),p=E.useMemo(()=>({setPositionReference:u}),[]),f=E.useMemo(()=>({reference:d||o.reference||null,floating:o.floating||null,domReference:o.reference}),[d,o.reference,o.floating]);return E.useMemo(()=>({dataRef:s,open:t,onOpenChange:_,elements:f,events:a,floatingId:r,refs:p}),[t,_,f,a,r,p])}function $o(e){e===void 0&&(e={});const{nodeId:t}=e,n=xd({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,r=o.elements,[s,a]=E.useState(null),[l,d]=E.useState(null),_=r?.domReference||s,p=E.useRef(null),f=it();Ve(()=>{_&&(p.current=_)},[_]);const c=ed({...e,elements:{...r,...l&&{reference:l}}}),h=E.useCallback(x=>{const k=Oe(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),getClientRects:()=>x.getClientRects(),contextElement:x}:x;d(k),c.refs.setReference(k)},[c.refs]),g=E.useCallback(x=>{(Oe(x)||x===null)&&(p.current=x,a(x)),(Oe(c.refs.reference.current)||c.refs.reference.current===null||x!==null&&!Oe(x))&&c.refs.setReference(x)},[c.refs]),v=E.useMemo(()=>({...c.refs,setReference:g,setPositionReference:h,domReference:p}),[c.refs,g,h]),w=E.useMemo(()=>({...c.elements,domReference:_}),[c.elements,_]),y=E.useMemo(()=>({...c,...o,refs:v,elements:w,nodeId:t}),[c,v,w,t,o]);return Ve(()=>{o.dataRef.current.floatingContext=y;const x=f?.nodesRef.current.find(k=>k.id===t);x&&(x.context=y)}),E.useMemo(()=>({...c,context:y,refs:v,elements:w}),[c,v,w,y])}function xr(){return sc()&&Oi()}function $d(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,events:r,dataRef:s,elements:a}=e,{enabled:l=!0,visibleOnly:d=!0}=t,u=E.useRef(!1),_=E.useRef(-1),p=E.useRef(!0);E.useEffect(()=>{if(!l)return;const c=vn(a.domReference);function h(){!n&&Je(a.domReference)&&a.domReference===Fn(cn(a.domReference))&&(u.current=!0)}function g(){p.current=!0}function v(){p.current=!1}return c.addEventListener("blur",h),xr()&&(c.addEventListener("keydown",g,!0),c.addEventListener("pointerdown",v,!0)),()=>{c.removeEventListener("blur",h),xr()&&(c.removeEventListener("keydown",g,!0),c.removeEventListener("pointerdown",v,!0))}},[a.domReference,n,l]),E.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]),E.useEffect(()=>()=>{un(_)},[]);const f=E.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(c){if(u.current)return;const h=Vn(c.nativeEvent);if(d&&Oe(h)){if(xr()&&!c.relatedTarget){if(!p.current&&!cr(h))return}else if(!uc(h))return}o(!0,c.nativeEvent,"focus")},onBlur(c){u.current=!1;const h=c.relatedTarget,g=c.nativeEvent,v=Oe(h)&&h.hasAttribute(st("focus-guard"))&&h.getAttribute("data-type")==="outside";_.current=window.setTimeout(()=>{var w;const y=Fn(a.domReference?a.domReference.ownerDocument:document);!h&&y===a.domReference||ln((w=s.current.floatingContext)==null?void 0:w.refs.floating.current,y)||ln(a.domReference,y)||v||o(!1,g,"focus")})}}),[s,a.domReference,o,d]);return E.useMemo(()=>l?{reference:f}:{},[l,f])}function $r(e,t,n){const o=new Map,r=n==="item";let s=e;if(r&&e){const{[ds]:a,[us]:l,...d}=e;s=d}return{...n==="floating"&&{tabIndex:-1,[od]:""},...s,...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,_]=d;if(!(r&&[ds,us].includes(u)))if(u.indexOf("on")===0){if(o.has(u)||o.set(u,[]),typeof _=="function"){var p;(p=o.get(u))==null||p.push(_),a[u]=function(){for(var f,c=arguments.length,h=new Array(c),g=0;g<c;g++)h[g]=arguments[g];return(f=o.get(u))==null?void 0:f.map(v=>v(...h)).find(v=>v!==void 0)}}}else a[u]=_}),a),{})}}function So(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=>$r(l,e,"reference"),t),s=E.useCallback(l=>$r(l,e,"floating"),n),a=E.useCallback(l=>$r(l,e,"item"),o);return E.useMemo(()=>({getReferenceProps:r,getFloatingProps:s,getItemProps:a}),[r,s,a])}const Sd="Escape";function ko(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Io(e,t){return ko(t,e===fs||e===ho,e===Lt||e===Dt)}function Sr(e,t,n){return ko(t,e===ho,n?e===Lt:e===Dt)||e==="Enter"||e===" "||e===""}function zs(e,t,n){return ko(t,n?e===Lt:e===Dt,e===ho)}function Ps(e,t,n,o){const r=n?e===Dt:e===Lt,s=e===fs;return t==="both"||t==="horizontal"&&o&&o>1?e===Sd:ko(t,r,s)}function kr(e,t){const{open:n,onOpenChange:o,elements:r,floatingId:s}=e,{listRef:a,activeIndex:l,onNavigate:d=()=>{},enabled:u=!0,selectedIndex:_=null,allowEscape:p=!1,loop:f=!1,nested:c=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:v="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:y=!0,disabledIndices:x=void 0,orientation:k="vertical",parentOrientation:L,cols:A=1,scrollItemIntoView:M=!0,virtualItemRef:T,itemSizes:P,dense:I=!1}=t;process.env.NODE_ENV!=="production"&&(p&&(f||mo("`useListNavigation` looping must be enabled to allow escaping."),g||mo("`useListNavigation` must be virtual to allow escaping.")),k==="vertical"&&A>1&&mo("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const q=io(r.floating),V=an(q),S=mt(),b=it();Ve(()=>{e.dataRef.current.orientation=k},[e,k]);const $=Qe(()=>{d(C.current===-1?null:C.current)}),D=dr(r.domReference),N=E.useRef(v),C=E.useRef(_??-1),z=E.useRef(null),O=E.useRef(!0),W=E.useRef($),G=E.useRef(!!r.floating),F=E.useRef(n),j=E.useRef(!1),B=E.useRef(!1),te=an(x),Z=an(n),R=an(M),ge=an(_),[fe,Ce]=E.useState(),[Q,se]=E.useState(),re=Qe(()=>{function U(pe){if(g){var he;(he=pe.id)!=null&&he.endsWith("-fui-option")&&(pe.id=s+"-"+Math.random().toString(16).slice(2,10)),Ce(pe.id),b?.events.emit("virtualfocus",pe),T&&(T.current=pe)}else at(pe,{sync:j.current,preventScroll:!0})}const H=a.current[C.current],K=B.current;H&&U(H),(j.current?pe=>pe():requestAnimationFrame)(()=>{const pe=a.current[C.current]||H;if(!pe)return;H||U(pe);const he=R.current;he&&le&&(K||!O.current)&&(pe.scrollIntoView==null||pe.scrollIntoView(typeof he=="boolean"?{block:"nearest",inline:"nearest"}:he))})});Ve(()=>{u&&(n&&r.floating?N.current&&_!=null&&(B.current=!0,C.current=_,$()):G.current&&(C.current=-1,W.current()))},[u,n,r.floating,_,$]),Ve(()=>{if(u&&n&&r.floating)if(l==null){if(j.current=!1,ge.current!=null)return;if(G.current&&(C.current=-1,re()),(!F.current||!G.current)&&N.current&&(z.current!=null||N.current===!0&&z.current==null)){let U=0;const H=()=>{a.current[0]==null?(U<2&&(U?requestAnimationFrame:queueMicrotask)(H),U++):(C.current=z.current==null||Sr(z.current,k,h)||c?ur(a,te.current):Gi(a,te.current),z.current=null,$())};H()}}else Nt(a,l)||(C.current=l,re(),B.current=!1)},[u,n,r.floating,l,ge,c,a,k,h,$,re,te]),Ve(()=>{var U;if(!u||r.floating||!b||g||!G.current)return;const H=b.nodesRef.current,K=(U=H.find(he=>he.id===S))==null||(U=U.context)==null?void 0:U.elements.floating,ie=Fn(cn(r.floating)),pe=H.some(he=>he.context&&ln(he.context.elements.floating,ie));K&&!pe&&O.current&&K.focus({preventScroll:!0})},[u,r.floating,b,S,g]),Ve(()=>{if(!u||!b||!g||S)return;function U(H){se(H.id),T&&(T.current=H)}return b.events.on("virtualfocus",U),()=>{b.events.off("virtualfocus",U)}},[u,b,g,S,T]),Ve(()=>{W.current=$,F.current=n,G.current=!!r.floating}),Ve(()=>{n||(z.current=null,N.current=v)},[n,v]);const be=l!=null,le=E.useMemo(()=>{function U(K){if(!Z.current)return;const ie=a.current.indexOf(K);ie!==-1&&C.current!==ie&&(C.current=ie,$())}return{onFocus(K){let{currentTarget:ie}=K;j.current=!0,U(ie)},onClick:K=>{let{currentTarget:ie}=K;return ie.focus({preventScroll:!0})},onMouseMove(K){let{currentTarget:ie}=K;j.current=!0,B.current=!1,w&&U(ie)},onPointerLeave(K){let{pointerType:ie}=K;if(!(!O.current||ie==="touch")&&(j.current=!0,!!w&&(C.current=-1,$(),!g))){var pe;(pe=V.current)==null||pe.focus({preventScroll:!0})}}}},[Z,V,w,a,$,g]),ne=E.useCallback(()=>{var U;return L??(b==null||(U=b.nodesRef.current.find(H=>H.id===S))==null||(U=U.context)==null||(U=U.dataRef)==null?void 0:U.current.orientation)},[S,b,L]),ue=Qe(U=>{if(O.current=!1,j.current=!0,U.which===229||!Z.current&&U.currentTarget===V.current)return;if(c&&Ps(U.key,k,h,A)){Io(U.key,ne())||dn(U),o(!1,U.nativeEvent,"list-navigation"),Je(r.domReference)&&(g?b?.events.emit("virtualfocus",r.domReference):r.domReference.focus());return}const H=C.current,K=ur(a,x),ie=Gi(a,x);if(D||(U.key==="Home"&&(dn(U),C.current=K,$()),U.key==="End"&&(dn(U),C.current=ie,$())),A>1){const pe=P||Array.from({length:a.current.length},()=>({width:1,height:1})),he=bc(pe,A,I),en=he.findIndex(Fe=>Fe!=null&&!ao(a,Fe,x)),Xe=he.reduce((Fe,rn,ke)=>rn!=null&&!ao(a,rn,x)?ke:Fe,-1),De=he[vc({current:he.map(Fe=>Fe!=null?a.current[Fe]:null)},{event:U,orientation:k,loop:f,rtl:h,cols:A,disabledIndices:yc([...(typeof x!="function"?x:null)||a.current.map((Fe,rn)=>ao(a,rn,x)?rn:void 0),void 0],he),minIndex:en,maxIndex:Xe,prevIndex:wc(C.current>ie?K:C.current,pe,he,A,U.key===ho?"bl":U.key===(h?Lt:Dt)?"tr":"tl"),stopEvent:!0})];if(De!=null&&(C.current=De,$()),k==="both")return}if(Io(U.key,k)){if(dn(U),n&&!g&&Fn(U.currentTarget.ownerDocument)===U.currentTarget){C.current=Sr(U.key,k,h)?K:ie,$();return}Sr(U.key,k,h)?f?C.current=H>=ie?p&&H!==a.current.length?-1:K:fn(a,{startingIndex:H,disabledIndices:x}):C.current=Math.min(ie,fn(a,{startingIndex:H,disabledIndices:x})):f?C.current=H<=K?p&&H!==-1?a.current.length:ie:fn(a,{startingIndex:H,decrement:!0,disabledIndices:x}):C.current=Math.max(K,fn(a,{startingIndex:H,decrement:!0,disabledIndices:x})),Nt(a,C.current)&&(C.current=-1),$()}}),we=E.useMemo(()=>g&&n&&be&&{"aria-activedescendant":Q||fe},[g,n,be,Q,fe]),oe=E.useMemo(()=>({"aria-orientation":k==="both"?void 0:k,...D?{}:we,onKeyDown:ue,onPointerMove(){O.current=!0}}),[we,ue,k,D]),ye=E.useMemo(()=>{function U(K){v==="auto"&&Bi(K.nativeEvent)&&(N.current=!0)}function H(K){N.current=v,v==="auto"&&Hi(K.nativeEvent)&&(N.current=!0)}return{...we,onKeyDown(K){O.current=!1;const ie=K.key.startsWith("Arrow"),pe=["Home","End"].includes(K.key),he=ie||pe,en=zs(K.key,k,h),Xe=Ps(K.key,k,h,A),De=zs(K.key,ne(),h),Fe=Io(K.key,k),rn=(c?De:Fe)||K.key==="Enter"||K.key.trim()==="";if(g&&n){const je=b?.nodesRef.current.find(xn=>xn.parentId==null),Ae=b&&je?fc(b.nodesRef.current,je.id):null;if(he&&Ae&&T){const xn=new KeyboardEvent("keydown",{key:K.key,bubbles:!0});if(en||Xe){var ke,me;const Le=((ke=Ae.context)==null?void 0:ke.elements.domReference)===K.currentTarget,Ye=Xe&&!Le?(me=Ae.context)==null?void 0:me.elements.domReference:en?a.current.find($n=>$n?.id===fe):null;Ye&&(dn(K),Ye.dispatchEvent(xn),se(void 0))}if((Fe||pe)&&Ae.context&&Ae.context.open&&Ae.parentId&&K.currentTarget!==Ae.context.elements.domReference){var xe;dn(K),(xe=Ae.context.elements.domReference)==null||xe.dispatchEvent(xn);return}}return ue(K)}if(!(!n&&!y&&ie)){if(rn){const je=Io(K.key,ne());z.current=c&&je?null:K.key}if(c){De&&(dn(K),n?(C.current=ur(a,te.current),$()):o(!0,K.nativeEvent,"list-navigation"));return}Fe&&(_!=null&&(C.current=_),dn(K),!n&&y?o(!0,K.nativeEvent,"list-navigation"):ue(K),n&&$())}},onFocus(){n&&!g&&(C.current=-1,$())},onPointerDown:H,onPointerEnter:H,onMouseDown:U,onClick:U}},[fe,we,A,ue,te,v,a,c,$,o,n,y,k,ne,h,_,b,g,T]);return E.useMemo(()=>u?{reference:ye,floating:oe,item:le}:{},[u,ye,oe,le])}const kd=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Eo(e,t){var n,o;t===void 0&&(t={});const{open:r,elements:s,floatingId:a}=e,{enabled:l=!0,role:d="dialog"}=t,u=zt(),_=((n=s.domReference)==null?void 0:n.id)||u,p=E.useMemo(()=>{var y;return((y=io(s.floating))==null?void 0:y.id)||a},[s.floating,a]),f=(o=kd.get(d))!=null?o:d,h=mt()!=null,g=E.useMemo(()=>f==="tooltip"||d==="label"?{["aria-"+(d==="label"?"labelledby":"describedby")]:r?p:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":f==="alertdialog"?"dialog":f,"aria-controls":r?p:void 0,...f==="listbox"&&{role:"combobox"},...f==="menu"&&{id:_},...f==="menu"&&h&&{role:"menuitem"},...d==="select"&&{"aria-autocomplete":"none"},...d==="combobox"&&{"aria-autocomplete":"list"}},[f,p,h,r,_,d]),v=E.useMemo(()=>{const y={id:p,...f&&{role:f}};return f==="tooltip"||d==="label"?y:{...y,...f==="menu"&&{"aria-labelledby":_}}},[f,p,_,d]),w=E.useCallback(y=>{let{active:x,selected:k}=y;const L={role:"option",...x&&{id:p+"-fui-option"}};switch(d){case"select":case"combobox":return{...L,"aria-selected":k}}return{}},[p,d]);return E.useMemo(()=>l?{reference:g,floating:v,item:w}:{},[l,g,v,w])}const Ts=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function bt(e,t){return typeof e=="function"?e(t):e}function Id(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 Ed(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=Id(n,a);return!u&&l==="close"&&d("unmounted"),Ve(()=>{if(o){if(n){d("initial");const _=requestAnimationFrame(()=>{Ho.flushSync(()=>{d("open")})});return()=>{cancelAnimationFrame(_)}}d("close")}},[n,o]),{isMounted:u,status:l}}function Mo(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:o,close:r,common:s,duration:a=250}=t,l=e.placement,d=l.split("-")[0],u=E.useMemo(()=>({side:d,placement:l}),[d,l]),_=typeof a=="number",p=(_?a:a.open)||0,f=(_?a:a.close)||0,[c,h]=E.useState(()=>({...bt(s,u),...bt(n,u)})),{isMounted:g,status:v}=Ed(e,{duration:a}),w=an(n),y=an(o),x=an(r),k=an(s);return Ve(()=>{const L=bt(w.current,u),A=bt(x.current,u),M=bt(k.current,u),T=bt(y.current,u)||Object.keys(L).reduce((P,I)=>(P[I]="",P),{});if(v==="initial"&&h(P=>({transitionProperty:P.transitionProperty,...M,...L})),v==="open"&&h({transitionProperty:Object.keys(T).map(Ts).join(","),transitionDuration:p+"ms",...M,...T}),v==="close"){const P=A||L;h({transitionProperty:Object.keys(P).map(Ts).join(","),transitionDuration:f+"ms",...M,...P})}},[f,x,w,y,k,p,v,u]),{isMounted:g,styles:c}}function Os(e,t){var n;const{open:o,dataRef:r}=e,{listRef:s,activeIndex:a,onMatch:l,onTypingChange:d,enabled:u=!0,findMatch:_=null,resetMs:p=750,ignoreKeys:f=[],selectedIndex:c=null}=t,h=E.useRef(-1),g=E.useRef(""),v=E.useRef((n=c??a)!=null?n:-1),w=E.useRef(null),y=Qe(l),x=Qe(d),k=an(_),L=an(f);Ve(()=>{o&&(un(h),w.current=null,g.current="")},[o]),Ve(()=>{if(o&&g.current===""){var I;v.current=(I=c??a)!=null?I:-1}},[o,c,a]);const A=Qe(I=>{I?r.current.typing||(r.current.typing=I,x(I)):r.current.typing&&(r.current.typing=I,x(I))}),M=Qe(I=>{function q(D,N,C){const z=k.current?k.current(N,C):N.find(O=>O?.toLocaleLowerCase().indexOf(C.toLocaleLowerCase())===0);return z?D.indexOf(z):-1}const V=s.current;if(g.current.length>0&&g.current[0]!==" "&&(q(V,V,g.current)===-1?A(!1):I.key===" "&&dn(I)),V==null||L.current.includes(I.key)||I.key.length!==1||I.ctrlKey||I.metaKey||I.altKey)return;o&&I.key!==" "&&(dn(I),A(!0)),V.every(D=>{var N,C;return D?((N=D[0])==null?void 0:N.toLocaleLowerCase())!==((C=D[1])==null?void 0:C.toLocaleLowerCase()):!0})&&g.current===I.key&&(g.current="",v.current=w.current),g.current+=I.key,un(h),h.current=window.setTimeout(()=>{g.current="",v.current=w.current,A(!1)},p);const b=v.current,$=q(V,[...V.slice((b||0)+1),...V.slice(0,(b||0)+1)],g.current);$!==-1?(y($),w.current=$):I.key!==" "&&(g.current="",A(!1))}),T=E.useMemo(()=>({onKeyDown:M}),[M]),P=E.useMemo(()=>({onKeyDown:M,onKeyUp(I){I.key===" "&&A(!1)}}),[M,A]);return E.useMemo(()=>u?{reference:T,floating:P}:{},[u,T,P])}function Vs(e,t,n){return n===void 0&&(n=!0),e.filter(r=>{var s;return r.parentId===t&&(!n||((s=r.context)==null?void 0:s.open))}).flatMap(r=>[r,...Vs(e,r.id,n)])}function qs(e,t){const[n,o]=e;let r=!1;const s=t.length;for(let a=0,l=s-1;a<s;l=a++){const[d,u]=t[a]||[0,0],[_,p]=t[l]||[0,0];u>=o!=p>=o&&n<=(_-d)*(o-u)/(p-u)+d&&(r=!r)}return r}function Md(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function js(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,r={current:-1};let s=!1,a=null,l=null,d=typeof performance<"u"?performance.now():0;function u(p,f){const c=performance.now(),h=c-d;if(a===null||l===null||h===0)return a=p,l=f,d=c,null;const g=p-a,v=f-l,y=Math.sqrt(g*g+v*v)/h;return a=p,l=f,d=c,y}const _=p=>{let{x:f,y:c,placement:h,elements:g,onClose:v,nodeId:w,tree:y}=p;return function(k){function L(){un(r),v()}if(un(r),!g.domReference||!g.floating||h==null||f==null||c==null)return;const{clientX:A,clientY:M}=k,T=[A,M],P=dd(k),I=k.type==="mouseleave",q=br(g.floating,P),V=br(g.domReference,P),S=g.domReference.getBoundingClientRect(),b=g.floating.getBoundingClientRect(),$=h.split("-")[0],D=f>b.right-b.width/2,N=c>b.bottom-b.height/2,C=Md(T,S),z=b.width>S.width,O=b.height>S.height,W=(z?S:b).left,G=(z?S:b).right,F=(O?S:b).top,j=(O?S:b).bottom;if(q&&(s=!0,!I))return;if(V&&(s=!1),V&&!I){s=!0;return}if(I&&Oe(k.relatedTarget)&&br(g.floating,k.relatedTarget)||y&&Vs(y.nodesRef.current,w).length)return;if($==="top"&&c>=S.bottom-1||$==="bottom"&&c<=S.top+1||$==="left"&&f>=S.right-1||$==="right"&&f<=S.left+1)return L();let B=[];switch($){case"top":B=[[W,S.top+1],[W,b.bottom-1],[G,b.bottom-1],[G,S.top+1]];break;case"bottom":B=[[W,b.top+1],[W,S.bottom-1],[G,S.bottom-1],[G,b.top+1]];break;case"left":B=[[b.right-1,j],[b.right-1,F],[S.left+1,F],[S.left+1,j]];break;case"right":B=[[S.right-1,j],[S.right-1,F],[b.left+1,F],[b.left+1,j]];break}function te(Z){let[R,ge]=Z;switch($){case"top":{const fe=[z?R+t/2:D?R+t*4:R-t*4,ge+t+1],Ce=[z?R-t/2:D?R+t*4:R-t*4,ge+t+1],Q=[[b.left,D||z?b.bottom-t:b.top],[b.right,D?z?b.bottom-t:b.top:b.bottom-t]];return[fe,Ce,...Q]}case"bottom":{const fe=[z?R+t/2:D?R+t*4:R-t*4,ge-t],Ce=[z?R-t/2:D?R+t*4:R-t*4,ge-t],Q=[[b.left,D||z?b.top+t:b.bottom],[b.right,D?z?b.top+t:b.bottom:b.top+t]];return[fe,Ce,...Q]}case"left":{const fe=[R+t+1,O?ge+t/2:N?ge+t*4:ge-t*4],Ce=[R+t+1,O?ge-t/2:N?ge+t*4:ge-t*4];return[...[[N||O?b.right-t:b.left,b.top],[N?O?b.right-t:b.left:b.right-t,b.bottom]],fe,Ce]}case"right":{const fe=[R-t,O?ge+t/2:N?ge+t*4:ge-t*4],Ce=[R-t,O?ge-t/2:N?ge+t*4:ge-t*4],Q=[[N||O?b.left+t:b.right,b.top],[N?O?b.left+t:b.right:b.left+t,b.bottom]];return[fe,Ce,...Q]}}}if(!qs([A,M],B)){if(s&&!C)return L();if(!I&&o){const Z=u(k.clientX,k.clientY);if(Z!==null&&Z<.1)return L()}qs([A,M],te([f,c]))?!s&&o&&(r.current=window.setTimeout(L,40)):L()}}};return _.__options={blockPointerEvents:n},_}function wt(e,t,n){let o=n.initialDeps??[],r;function s(){var a,l,d,u;let _;n.key&&((a=n.debug)!=null&&a.call(n))&&(_=Date.now());const p=e();if(!(p.length!==o.length||p.some((h,g)=>o[g]!==h)))return r;o=p;let c;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(c=Date.now()),r=t(...p),n.key&&((d=n.debug)!=null&&d.call(n))){const h=Math.round((Date.now()-_)*100)/100,g=Math.round((Date.now()-c)*100)/100,v=g/16,w=(y,x)=>{for(y=String(y);y.length<x;)y=" "+y;return y};console.info(`%c⏱ ${w(g,5)} /${w(h,5)} ms`,`
4
+ */var kc=["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])"],fo=kc.join(","),Wa=typeof Element>"u",yn=Wa?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,po=!Wa&&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},An=function(n,t){var o;t===void 0&&(t=!0);var a=n==null||(o=n.getAttribute)===null||o===void 0?void 0:o.call(n,"inert"),i=a===""||a==="true",s=i||t&&n&&An(n.parentNode);return s},Nc=function(n){var t,o=n==null||(t=n.getAttribute)===null||t===void 0?void 0:t.call(n,"contenteditable");return o===""||o==="true"},Ga=function(n,t,o){if(An(n))return[];var a=Array.prototype.slice.apply(n.querySelectorAll(fo));return t&&yn.call(n,fo)&&a.unshift(n),a=a.filter(o),a},go=function(n,t,o){for(var a=[],i=Array.from(n);i.length;){var s=i.shift();if(!An(s,!1))if(s.tagName==="SLOT"){var l=s.assignedElements(),c=l.length?l:s.children,u=go(c,!0,o);o.flatten?a.push.apply(a,u):a.push({scopeParent:s,candidates:u})}else{var _=yn.call(s,fo);_&&o.filter(s)&&(t||!n.includes(s))&&a.push(s);var g=s.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(s),f=!An(g,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(s));if(g&&f){var d=go(g===!0?s.children:g.children,!0,o);o.flatten?a.push.apply(a,d):a.push({scopeParent:s,candidates:d})}else i.unshift.apply(i,s.children)}}return a},Za=function(n){return!isNaN(parseInt(n.getAttribute("tabindex"),10))},Ua=function(n){if(!n)throw new Error("No node provided");return n.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(n.tagName)||Nc(n))&&!Za(n)?0:n.tabIndex},Ec=function(n,t){var o=Ua(n);return o<0&&t&&!Za(n)?0:o},Mc=function(n,t){return n.tabIndex===t.tabIndex?n.documentOrder-t.documentOrder:n.tabIndex-t.tabIndex},Ka=function(n){return n.tagName==="INPUT"},Ic=function(n){return Ka(n)&&n.type==="hidden"},Fc=function(n){var t=n.tagName==="DETAILS"&&Array.prototype.slice.apply(n.children).some(function(o){return o.tagName==="SUMMARY"});return t},zc=function(n,t){for(var o=0;o<n.length;o++)if(n[o].checked&&n[o].form===t)return n[o]},Lc=function(n){if(!n.name)return!0;var t=n.form||po(n),o=function(l){return t.querySelectorAll('input[type="radio"][name="'+l+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=o(window.CSS.escape(n.name));else try{a=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=zc(a,n.form);return!i||i===n},Ac=function(n){return Ka(n)&&n.type==="radio"},Dc=function(n){return Ac(n)&&!Lc(n)},Pc=function(n){var t,o=n&&po(n),a=(t=o)===null||t===void 0?void 0:t.host,i=!1;if(o&&o!==n){var s,l,c;for(i=!!((s=a)!==null&&s!==void 0&&(l=s.ownerDocument)!==null&&l!==void 0&&l.contains(a)||n!=null&&(c=n.ownerDocument)!==null&&c!==void 0&&c.contains(n));!i&&a;){var u,_,g;o=po(a),a=(u=o)===null||u===void 0?void 0:u.host,i=!!((_=a)!==null&&_!==void 0&&(g=_.ownerDocument)!==null&&g!==void 0&&g.contains(a))}}return i},Xa=function(n){var t=n.getBoundingClientRect(),o=t.width,a=t.height;return o===0&&a===0},Tc=function(n,t){var o=t.displayCheck,a=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=yn.call(n,"details>summary:first-of-type"),l=s?n.parentElement:n;if(yn.call(l,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof a=="function"){for(var c=n;n;){var u=n.parentElement,_=po(n);if(u&&!u.shadowRoot&&a(u)===!0)return Xa(n);n.assignedSlot?n=n.assignedSlot:!u&&_!==n.ownerDocument?n=_.host:n=u}n=c}if(Pc(n))return!n.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Xa(n);return!1},Oc=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 a=t.children.item(o);if(a.tagName==="LEGEND")return yn.call(t,"fieldset[disabled] *")?!0:!a.contains(n)}return!0}t=t.parentElement}return!1},br=function(n,t){return!(t.disabled||An(t)||Ic(t)||Tc(t,n)||Fc(t)||Oc(t))},wr=function(n,t){return!(Dc(t)||Ua(t)<0||!br(n,t))},Vc=function(n){var t=parseInt(n.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ya=function(n){var t=[],o=[];return n.forEach(function(a,i){var s=!!a.scopeParent,l=s?a.scopeParent:a,c=Ec(l,s),u=s?Ya(a.candidates):l;c===0?s?t.push.apply(t,u):t.push(l):o.push({documentOrder:i,tabIndex:c,item:a,isScope:s,content:u})}),o.sort(Mc).reduce(function(a,i){return i.isScope?a.push.apply(a,i.content):a.push(i.content),a},[]).concat(t)},ho=function(n,t){t=t||{};var o;return t.getShadowRoot?o=go([n],t.includeContainer,{filter:wr.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Vc}):o=Ga(n,t.includeContainer,wr.bind(null,t)),Ya(o)},Bc=function(n,t){t=t||{};var o;return t.getShadowRoot?o=go([n],t.includeContainer,{filter:br.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):o=Ga(n,t.includeContainer,br.bind(null,t)),o},Ja=function(n,t){if(t=t||{},!n)throw new Error("No node provided");return yn.call(n,fo)===!1?!1:wr(t,n)};function Qa(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Ra(){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 ei(){return/apple/i.test(navigator.vendor)}function yr(){const e=/android/i;return e.test(Qa())||e.test(Ra())}function jc(){return Qa().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function ti(){return Ra().includes("jsdom/")}const ni="data-floating-ui-focusable",qc="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Cr="ArrowLeft",xr="ArrowRight",Hc="ArrowUp",Wc="ArrowDown";function Dt(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 ct(e,n){if(!e||!n)return!1;const t=n.getRootNode==null?void 0:n.getRootNode();if(e.contains(n))return!0;if(t&&ao(t)){let o=n;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Ht(e){return"composedPath"in e?e.composedPath()[0]:e.target}function $r(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 Gc(e){return e.matches("html,body")}function dt(e){return e?.ownerDocument||document}function Sr(e){return tt(e)&&e.matches(qc)}function kr(e){return e?e.getAttribute("role")==="combobox"&&Sr(e):!1}function Zc(e){if(!e||ti())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function mo(e){return e?e.hasAttribute(ni)?e:e.querySelector("["+ni+"]")||e:null}function sn(e,n,t){return t===void 0&&(t=!0),e.filter(a=>{var i;return a.parentId===n&&(!t||((i=a.context)==null?void 0:i.open))}).flatMap(a=>[a,...sn(e,a.id,t)])}function Uc(e,n){let t,o=-1;function a(i,s){s>o&&(t=i,o=s),sn(e,i).forEach(c=>{a(c.id,s+1)})}return a(n,0),e.find(i=>i.id===t)}function oi(e,n){var t;let o=[],a=(t=e.find(i=>i.id===n))==null?void 0:t.parentId;for(;a;){const i=e.find(s=>s.id===a);a=i?.parentId,i&&(o=o.concat(i))}return o}function ut(e){e.preventDefault(),e.stopPropagation()}function Kc(e){return"nativeEvent"in e}function ri(e){return e.mozInputSource===0&&e.isTrusted?!0:yr()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function ai(e){return ti()?!1:!yr()&&e.width===0&&e.height===0||yr()&&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 Dn(e,n){const t=["mouse","pen"];return n||t.push("",void 0),t.includes(e)}var Xc=typeof document<"u",Yc=function(){},He=Xc?h.useLayoutEffect:Yc;const Jc={...M};function st(e){const n=M.useRef(e);return He(()=>{n.current=e}),n}const Qc=Jc.useInsertionEffect||(e=>e());function nt(e){const n=M.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Qc(()=>{n.current=e}),M.useCallback(function(){for(var t=arguments.length,o=new Array(t),a=0;a<t;a++)o[a]=arguments[a];return n.current==null?void 0:n.current(...o)},[])}function vo(e,n,t){return Math.floor(e/n)!==t}function Pn(e,n){return n<0||n>=e.current.length}function Nr(e,n){return ft(e,{disabledIndices:n})}function ii(e,n){return ft(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:n})}function ft(e,n){let{startingIndex:t=-1,decrement:o=!1,disabledIndices:a,amount:i=1}=n===void 0?{}:n,s=t;do s+=o?-i:i;while(s>=0&&s<=e.current.length-1&&bo(e,s,a));return s}function Rc(e,n){let{event:t,orientation:o,loop:a,rtl:i,cols:s,disabledIndices:l,minIndex:c,maxIndex:u,prevIndex:_,stopEvent:g=!1}=n,f=_;if(t.key===Hc){if(g&&ut(t),_===-1)f=u;else if(f=ft(e,{startingIndex:f,amount:s,decrement:!0,disabledIndices:l}),a&&(_-s<c||f<0)){const d=_%s,m=u%s,p=u-(m-d);m===d?f=u:f=m>d?p:p-s}Pn(e,f)&&(f=_)}if(t.key===Wc&&(g&&ut(t),_===-1?f=c:(f=ft(e,{startingIndex:_,amount:s,disabledIndices:l}),a&&_+s>u&&(f=ft(e,{startingIndex:_%s-s,amount:s,disabledIndices:l}))),Pn(e,f)&&(f=_)),o==="both"){const d=vn(_/s);t.key===(i?Cr:xr)&&(g&&ut(t),_%s!==s-1?(f=ft(e,{startingIndex:_,disabledIndices:l}),a&&vo(f,s,d)&&(f=ft(e,{startingIndex:_-_%s-1,disabledIndices:l}))):a&&(f=ft(e,{startingIndex:_-_%s-1,disabledIndices:l})),vo(f,s,d)&&(f=_)),t.key===(i?xr:Cr)&&(g&&ut(t),_%s!==0?(f=ft(e,{startingIndex:_,decrement:!0,disabledIndices:l}),a&&vo(f,s,d)&&(f=ft(e,{startingIndex:_+(s-_%s),decrement:!0,disabledIndices:l}))):a&&(f=ft(e,{startingIndex:_+(s-_%s),decrement:!0,disabledIndices:l})),vo(f,s,d)&&(f=_));const m=vn(u/s)===d;Pn(e,f)&&(a&&m?f=t.key===(i?xr:Cr)?u:ft(e,{startingIndex:_-_%s-1,disabledIndices:l}):f=_)}return f}function ed(e,n,t){const o=[];let a=0;return e.forEach((i,s)=>{let{width:l,height:c}=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&&(a=0);!u;){const _=[];for(let g=0;g<l;g++)for(let f=0;f<c;f++)_.push(a+g+f*n);a%n+l<=n&&_.every(g=>o[g]==null)?(_.forEach(g=>{o[g]=s}),u=!0):a++}}),[...o]}function td(e,n,t,o,a){if(e===-1)return-1;const i=t.indexOf(e),s=n[e];switch(a){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 nd(e,n){return n.flatMap((t,o)=>e.includes(t)?[o]:[])}function bo(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 Tn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function si(e,n){const t=ho(e,Tn()),o=t.length;if(o===0)return;const a=Dt(dt(e)),i=t.indexOf(a),s=i===-1?n===1?0:o-1:i+n;return t[s]}function li(e){return si(dt(e).body,1)||e}function ci(e){return si(dt(e).body,-1)||e}function On(e,n){const t=n||e.currentTarget,o=e.relatedTarget;return!o||!ct(t,o)}function od(e){ho(e,Tn()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function di(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 ui(e,n,t){let{reference:o,floating:a}=e;const i=qt(n),s=mr(n),l=hr(s),c=Jt(n),u=i==="y",_=o.x+o.width/2-a.width/2,g=o.y+o.height/2-a.height/2,f=o[l]/2-a[l]/2;let d;switch(c){case"top":d={x:_,y:o.y-a.height};break;case"bottom":d={x:_,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:g};break;case"left":d={x:o.x-a.width,y:g};break;default:d={x:o.x,y:o.y}}switch(wn(n)){case"start":d[s]-=f*(t&&u?-1:1);break;case"end":d[s]+=f*(t&&u?-1:1);break}return d}const rd=async(e,n,t)=>{const{placement:o="bottom",strategy:a="absolute",middleware:i=[],platform:s}=t,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(n));let u=await s.getElementRects({reference:e,floating:n,strategy:a}),{x:_,y:g}=ui(u,o,c),f=o,d={},m=0;for(let p=0;p<l.length;p++){const{name:v,fn:y}=l[p],{x:w,y:C,data:k,reset:z}=await y({x:_,y:g,initialPlacement:o,placement:f,strategy:a,middlewareData:d,rects:u,platform:s,elements:{reference:e,floating:n}});_=w??_,g=C??g,d={...d,[v]:{...d[v],...k}},z&&m<=50&&(m++,typeof z=="object"&&(z.placement&&(f=z.placement),z.rects&&(u=z.rects===!0?await s.getElementRects({reference:e,floating:n,strategy:a}):z.rects),{x:_,y:g}=ui(u,f,c)),p=-1)}return{x:_,y:g,placement:f,strategy:a,middlewareData:d}};async function Er(e,n){var t;n===void 0&&(n={});const{x:o,y:a,platform:i,rects:s,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:_="viewport",elementContext:g="floating",altBoundary:f=!1,padding:d=0}=bn(n,e),m=Ha(d),v=l[f?g==="floating"?"reference":"floating":g],y=_o(await i.getClippingRect({element:(t=await(i.isElement==null?void 0:i.isElement(v)))==null||t?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:_,strategy:c})),w=g==="floating"?{x:o,y:a,width:s.floating.width,height:s.floating.height}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),k=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},z=_o(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:C,strategy:c}):w);return{top:(y.top-z.top+m.top)/k.y,bottom:(z.bottom-y.bottom+m.bottom)/k.y,left:(y.left-z.left+m.left)/k.x,right:(z.right-y.right+m.right)/k.x}}const ad=e=>({name:"arrow",options:e,async fn(n){const{x:t,y:o,placement:a,rects:i,platform:s,elements:l,middlewareData:c}=n,{element:u,padding:_=0}=bn(e,n)||{};if(u==null)return{};const g=Ha(_),f={x:t,y:o},d=mr(a),m=hr(d),p=await s.getDimensions(u),v=d==="y",y=v?"top":"left",w=v?"bottom":"right",C=v?"clientHeight":"clientWidth",k=i.reference[m]+i.reference[d]-f[d]-i.floating[m],z=f[d]-i.reference[d],A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let N=A?A[C]:0;(!N||!await(s.isElement==null?void 0:s.isElement(A)))&&(N=l.floating[C]||i.floating[m]);const P=k/2-z/2,O=N/2-p[m]/2-1,E=Yt(g[y],O),T=Yt(g[w],O),V=E,S=N-p[m]-T,b=N/2-p[m]/2+P,x=gr(V,b,S),F=!c.arrow&&wn(a)!=null&&b!==x&&i.reference[m]/2-(b<V?E:T)-p[m]/2<0,I=F?b<V?b-V:b-S:0;return{[d]:f[d]+I,data:{[d]:x,centerOffset:b-x-I,...F&&{alignmentOffset:I}},reset:F}}}),id=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var t,o;const{placement:a,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:u}=n,{mainAxis:_=!0,crossAxis:g=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...v}=bn(e,n);if((t=i.arrow)!=null&&t.alignmentOffset)return{};const y=Jt(a),w=qt(l),C=Jt(l)===l,k=await(c.isRTL==null?void 0:c.isRTL(u.floating)),z=f||(C||!p?[uo(l)]:wc(l)),A=m!=="none";!f&&A&&z.push(...$c(l,p,m,k));const N=[l,...z],P=await Er(n,v),O=[];let E=((o=i.flip)==null?void 0:o.overflows)||[];if(_&&O.push(P[y]),g){const b=bc(a,s,k);O.push(P[b[0]],P[b[1]])}if(E=[...E,{placement:a,overflows:O}],!O.every(b=>b<=0)){var T,V;const b=(((T=i.flip)==null?void 0:T.index)||0)+1,x=N[b];if(x&&(!(g==="alignment"?w!==qt(x):!1)||E.every($=>qt($.placement)===w?$.overflows[0]>0:!0)))return{data:{index:b,overflows:E},reset:{placement:x}};let F=(V=E.filter(I=>I.overflows[0]<=0).sort((I,$)=>I.overflows[1]-$.overflows[1])[0])==null?void 0:V.placement;if(!F)switch(d){case"bestFit":{var S;const I=(S=E.filter($=>{if(A){const D=qt($.placement);return D===w||D==="y"}return!0}).map($=>[$.placement,$.overflows.filter(D=>D>0).reduce((D,B)=>D+B,0)]).sort(($,D)=>$[1]-D[1])[0])==null?void 0:S[0];I&&(F=I);break}case"initialPlacement":F=l;break}if(a!==F)return{reset:{placement:F}}}return{}}}},sd=new Set(["left","top"]);async function ld(e,n){const{placement:t,platform:o,elements:a}=e,i=await(o.isRTL==null?void 0:o.isRTL(a.floating)),s=Jt(t),l=wn(t),c=qt(t)==="y",u=sd.has(s)?-1:1,_=i&&c?-1:1,g=bn(n,e);let{mainAxis:f,crossAxis:d,alignmentAxis:m}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return l&&typeof m=="number"&&(d=l==="end"?m*-1:m),c?{x:d*_,y:f*u}:{x:f*u,y:d*_}}const cd=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var t,o;const{x:a,y:i,placement:s,middlewareData:l}=n,c=await ld(n,e);return s===((t=l.offset)==null?void 0:t.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:s}}}}},dd=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:t,y:o,placement:a}=n,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:v=>{let{x:y,y:w}=v;return{x:y,y:w}}},...c}=bn(e,n),u={x:t,y:o},_=await Er(n,c),g=qt(Jt(a)),f=Ba(g);let d=u[f],m=u[g];if(i){const v=f==="y"?"top":"left",y=f==="y"?"bottom":"right",w=d+_[v],C=d-_[y];d=gr(w,d,C)}if(s){const v=g==="y"?"top":"left",y=g==="y"?"bottom":"right",w=m+_[v],C=m-_[y];m=gr(w,m,C)}const p=l.fn({...n,[f]:d,[g]:m});return{...p,data:{x:p.x-t,y:p.y-o,enabled:{[f]:i,[g]:s}}}}}},ud=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var t,o;const{placement:a,rects:i,platform:s,elements:l}=n,{apply:c=()=>{},...u}=bn(e,n),_=await Er(n,u),g=Jt(a),f=wn(a),d=qt(a)==="y",{width:m,height:p}=i.floating;let v,y;g==="top"||g==="bottom"?(v=g,y=f===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(y=g,v=f==="end"?"top":"bottom");const w=p-_.top-_.bottom,C=m-_.left-_.right,k=Yt(p-_[v],w),z=Yt(m-_[y],C),A=!n.middlewareData.shift;let N=k,P=z;if((t=n.middlewareData.shift)!=null&&t.enabled.x&&(P=C),(o=n.middlewareData.shift)!=null&&o.enabled.y&&(N=w),A&&!f){const E=xt(_.left,0),T=xt(_.right,0),V=xt(_.top,0),S=xt(_.bottom,0);d?P=m-2*(E!==0||T!==0?E+T:xt(_.left,_.right)):N=p-2*(V!==0||S!==0?V+S:xt(_.top,_.bottom))}await c({...n,availableWidth:P,availableHeight:N});const O=await s.getDimensions(l.floating);return m!==O.width||p!==O.height?{reset:{rects:!0}}:{}}}};function _i(e){const n=Ct(e);let t=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const a=tt(e),i=a?e.offsetWidth:t,s=a?e.offsetHeight:o,l=co(t)!==i||co(o)!==s;return l&&(t=i,o=s),{width:t,height:o,$:l}}function Mr(e){return qe(e)?e:e.contextElement}function Cn(e){const n=Mr(e);if(!tt(n))return At(1);const t=n.getBoundingClientRect(),{width:o,height:a,$:i}=_i(n);let s=(i?co(t.width):t.width)/o,l=(i?co(t.height):t.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const _d=At(0);function fi(e){const n=vt(e);return!so()||!n.visualViewport?_d:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function fd(e,n,t){return n===void 0&&(n=!1),!t||n&&t!==vt(e)?!1:n}function ln(e,n,t,o){n===void 0&&(n=!1),t===void 0&&(t=!1);const a=e.getBoundingClientRect(),i=Mr(e);let s=At(1);n&&(o?qe(o)&&(s=Cn(o)):s=Cn(e));const l=fd(i,t,o)?fi(i):At(0);let c=(a.left+l.x)/s.x,u=(a.top+l.y)/s.y,_=a.width/s.x,g=a.height/s.y;if(i){const f=vt(i),d=o&&qe(o)?vt(o):o;let m=f,p=pr(m);for(;p&&o&&d!==m;){const v=Cn(p),y=p.getBoundingClientRect(),w=Ct(p),C=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*v.x,k=y.top+(p.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,u*=v.y,_*=v.x,g*=v.y,c+=C,u+=k,m=vt(p),p=pr(m)}}return _o({width:_,height:g,x:c,y:u})}function wo(e,n){const t=lo(e).scrollLeft;return n?n.left+t:ln(Lt(e)).left+t}function pi(e,n){const t=e.getBoundingClientRect(),o=t.left+n.scrollLeft-wo(e,t),a=t.top+n.scrollTop;return{x:o,y:a}}function pd(e){let{elements:n,rect:t,offsetParent:o,strategy:a}=e;const i=a==="fixed",s=Lt(o),l=n?io(n.floating):!1;if(o===s||l&&i)return t;let c={scrollLeft:0,scrollTop:0},u=At(1);const _=At(0),g=tt(o);if((g||!g&&!i)&&((Kt(o)!=="body"||Ln(s))&&(c=lo(o)),tt(o))){const d=ln(o);u=Cn(o),_.x=d.x+o.clientLeft,_.y=d.y+o.clientTop}const f=s&&!g&&!i?pi(s,c):At(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-c.scrollLeft*u.x+_.x+f.x,y:t.y*u.y-c.scrollTop*u.y+_.y+f.y}}function gd(e){return Array.from(e.getClientRects())}function hd(e){const n=Lt(e),t=lo(e),o=e.ownerDocument.body,a=xt(n.scrollWidth,n.clientWidth,o.scrollWidth,o.clientWidth),i=xt(n.scrollHeight,n.clientHeight,o.scrollHeight,o.clientHeight);let s=-t.scrollLeft+wo(e);const l=-t.scrollTop;return Ct(o).direction==="rtl"&&(s+=xt(n.clientWidth,o.clientWidth)-a),{width:a,height:i,x:s,y:l}}const gi=25;function md(e,n){const t=vt(e),o=Lt(e),a=t.visualViewport;let i=o.clientWidth,s=o.clientHeight,l=0,c=0;if(a){i=a.width,s=a.height;const _=so();(!_||_&&n==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}const u=wo(o);if(u<=0){const _=o.ownerDocument,g=_.body,f=getComputedStyle(g),d=_.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(o.clientWidth-g.clientWidth-d);m<=gi&&(i-=m)}else u<=gi&&(i+=u);return{width:i,height:s,x:l,y:c}}const vd=new Set(["absolute","fixed"]);function bd(e,n){const t=ln(e,!0,n==="fixed"),o=t.top+e.clientTop,a=t.left+e.clientLeft,i=tt(e)?Cn(e):At(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=a*i.x,u=o*i.y;return{width:s,height:l,x:c,y:u}}function hi(e,n,t){let o;if(n==="viewport")o=md(e,t);else if(n==="document")o=hd(Lt(e));else if(qe(n))o=bd(n,t);else{const a=fi(e);o={x:n.x-a.x,y:n.y-a.y,width:n.width,height:n.height}}return _o(o)}function mi(e,n){const t=jt(e);return t===n||!qe(t)||Bt(t)?!1:Ct(t).position==="fixed"||mi(t,n)}function wd(e,n){const t=n.get(e);if(t)return t;let o=Xt(e,[],!1).filter(l=>qe(l)&&Kt(l)!=="body"),a=null;const i=Ct(e).position==="fixed";let s=i?jt(e):e;for(;qe(s)&&!Bt(s);){const l=Ct(s),c=fr(s);!c&&l.position==="fixed"&&(a=null),(i?!c&&!a:!c&&l.position==="static"&&!!a&&vd.has(a.position)||Ln(s)&&!c&&mi(e,s))?o=o.filter(_=>_!==s):a=l,s=jt(s)}return n.set(e,o),o}function yd(e){let{element:n,boundary:t,rootBoundary:o,strategy:a}=e;const s=[...t==="clippingAncestors"?io(n)?[]:wd(n,this._c):[].concat(t),o],l=s[0],c=s.reduce((u,_)=>{const g=hi(n,_,a);return u.top=xt(g.top,u.top),u.right=Yt(g.right,u.right),u.bottom=Yt(g.bottom,u.bottom),u.left=xt(g.left,u.left),u},hi(n,l,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Cd(e){const{width:n,height:t}=_i(e);return{width:n,height:t}}function xd(e,n,t){const o=tt(n),a=Lt(n),i=t==="fixed",s=ln(e,!0,i,n);let l={scrollLeft:0,scrollTop:0};const c=At(0);function u(){c.x=wo(a)}if(o||!o&&!i)if((Kt(n)!=="body"||Ln(a))&&(l=lo(n)),o){const d=ln(n,!0,i,n);c.x=d.x+n.clientLeft,c.y=d.y+n.clientTop}else a&&u();i&&!o&&a&&u();const _=a&&!o&&!i?pi(a,l):At(0),g=s.left+l.scrollLeft-c.x-_.x,f=s.top+l.scrollTop-c.y-_.y;return{x:g,y:f,width:s.width,height:s.height}}function Ir(e){return Ct(e).position==="static"}function vi(e,n){if(!tt(e)||Ct(e).position==="fixed")return null;if(n)return n(e);let t=e.offsetParent;return Lt(e)===t&&(t=t.ownerDocument.body),t}function bi(e,n){const t=vt(e);if(io(e))return t;if(!tt(e)){let a=jt(e);for(;a&&!Bt(a);){if(qe(a)&&!Ir(a))return a;a=jt(a)}return t}let o=vi(e,n);for(;o&&cc(o)&&Ir(o);)o=vi(o,n);return o&&Bt(o)&&Ir(o)&&!fr(o)?t:o||pc(e)||t}const $d=async function(e){const n=this.getOffsetParent||bi,t=this.getDimensions,o=await t(e.floating);return{reference:xd(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Sd(e){return Ct(e).direction==="rtl"}const kd={convertOffsetParentRelativeRectToViewportRelativeRect:pd,getDocumentElement:Lt,getClippingRect:yd,getOffsetParent:bi,getElementRects:$d,getClientRects:gd,getDimensions:Cd,getScale:Cn,isElement:qe,isRTL:Sd};function wi(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function Nd(e,n){let t=null,o;const a=Lt(e);function i(){var l;clearTimeout(o),(l=t)==null||l.disconnect(),t=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const u=e.getBoundingClientRect(),{left:_,top:g,width:f,height:d}=u;if(l||n(),!f||!d)return;const m=vn(g),p=vn(a.clientWidth-(_+f)),v=vn(a.clientHeight-(g+d)),y=vn(_),C={rootMargin:-m+"px "+-p+"px "+-v+"px "+-y+"px",threshold:xt(0,Yt(1,c))||1};let k=!0;function z(A){const N=A[0].intersectionRatio;if(N!==c){if(!k)return s();N?s(!1,N):o=setTimeout(()=>{s(!1,1e-7)},1e3)}N===1&&!wi(u,e.getBoundingClientRect())&&s(),k=!1}try{t=new IntersectionObserver(z,{...C,root:a.ownerDocument})}catch{t=new IntersectionObserver(z,C)}t.observe(e)}return s(!0),i}function yo(e,n,t,o){o===void 0&&(o={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,u=Mr(e),_=a||i?[...u?Xt(u):[],...Xt(n)]:[];_.forEach(y=>{a&&y.addEventListener("scroll",t,{passive:!0}),i&&y.addEventListener("resize",t)});const g=u&&l?Nd(u,t):null;let f=-1,d=null;s&&(d=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&d&&(d.unobserve(n),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var C;(C=d)==null||C.observe(n)})),t()}),u&&!c&&d.observe(u),d.observe(n));let m,p=c?ln(e):null;c&&v();function v(){const y=ln(e);p&&!wi(p,y)&&t(),p=y,m=requestAnimationFrame(v)}return t(),()=>{var y;_.forEach(w=>{a&&w.removeEventListener("scroll",t),i&&w.removeEventListener("resize",t)}),g?.(),(y=d)==null||y.disconnect(),d=null,c&&cancelAnimationFrame(m)}}const Ed=cd,Md=dd,Id=id,Fd=ud,yi=ad,zd=(e,n,t)=>{const o=new Map,a={platform:kd,...t},i={...a.platform,_c:o};return rd(e,n,{...a,platform:i})};var Ld=typeof document<"u",Ad=function(){},Co=Ld?h.useLayoutEffect:Ad;function xo(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,a;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(!xo(e[o],n[o]))return!1;return!0}if(a=Object.keys(e),t=a.length,t!==Object.keys(n).length)return!1;for(o=t;o--!==0;)if(!{}.hasOwnProperty.call(n,a[o]))return!1;for(o=t;o--!==0;){const i=a[o];if(!(i==="_owner"&&e.$$typeof)&&!xo(e[i],n[i]))return!1}return!0}return e!==e&&n!==n}function Ci(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xi(e,n){const t=Ci(e);return Math.round(n*t)/t}function Fr(e){const n=M.useRef(e);return Co(()=>{n.current=e}),n}function Dd(e){e===void 0&&(e={});const{placement:n="bottom",strategy:t="absolute",middleware:o=[],platform:a,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[_,g]=M.useState({x:0,y:0,strategy:t,placement:n,middlewareData:{},isPositioned:!1}),[f,d]=M.useState(o);xo(f,o)||d(o);const[m,p]=M.useState(null),[v,y]=M.useState(null),w=M.useCallback($=>{$!==A.current&&(A.current=$,p($))},[]),C=M.useCallback($=>{$!==N.current&&(N.current=$,y($))},[]),k=i||m,z=s||v,A=M.useRef(null),N=M.useRef(null),P=M.useRef(_),O=c!=null,E=Fr(c),T=Fr(a),V=Fr(u),S=M.useCallback(()=>{if(!A.current||!N.current)return;const $={placement:n,strategy:t,middleware:f};T.current&&($.platform=T.current),zd(A.current,N.current,$).then(D=>{const B={...D,isPositioned:V.current!==!1};b.current&&!xo(P.current,B)&&(P.current=B,ar.flushSync(()=>{g(B)}))})},[f,n,t,T,V]);Co(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,g($=>({...$,isPositioned:!1})))},[u]);const b=M.useRef(!1);Co(()=>(b.current=!0,()=>{b.current=!1}),[]),Co(()=>{if(k&&(A.current=k),z&&(N.current=z),k&&z){if(E.current)return E.current(k,z,S);S()}},[k,z,S,E,O]);const x=M.useMemo(()=>({reference:A,floating:N,setReference:w,setFloating:C}),[w,C]),F=M.useMemo(()=>({reference:k,floating:z}),[k,z]),I=M.useMemo(()=>{const $={position:t,left:0,top:0};if(!F.floating)return $;const D=xi(F.floating,_.x),B=xi(F.floating,_.y);return l?{...$,transform:"translate("+D+"px, "+B+"px)",...Ci(F.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:D,top:B}},[t,l,F.floating,_.x,_.y]);return M.useMemo(()=>({..._,update:S,refs:x,elements:F,floatingStyles:I}),[_,S,x,F,I])}const Pd=e=>{function n(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:e,fn(t){const{element:o,padding:a}=typeof e=="function"?e(t):e;return o&&n(o)?o.current!=null?yi({element:o.current,padding:a}).fn(t):{}:o?yi({element:o,padding:a}).fn(t):{}}}},$o=(e,n)=>({...Ed(e),options:[e,n]}),So=(e,n)=>({...Md(e),options:[e,n]}),ko=(e,n)=>({...Id(e),options:[e,n]}),$i=(e,n)=>({...Fd(e),options:[e,n]}),Td=(e,n)=>({...Pd(e),options:[e,n]});function Si(e){const n=M.useRef(void 0),t=M.useCallback(o=>{const a=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()=>{a.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 Od="data-floating-ui-focusable",ki="active",Ni="selected",Vn="ArrowLeft",Bn="ArrowRight",Ei="ArrowUp",No="ArrowDown",Vd={...M};let Mi=!1,Bd=0;const Ii=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Bd++;function jd(){const[e,n]=M.useState(()=>Mi?Ii():void 0);return He(()=>{e==null&&n(Ii())},[]),M.useEffect(()=>{Mi=!0},[]),e}const jn=Vd.useId||jd;let qn;process.env.NODE_ENV!=="production"&&(qn=new Set);function Eo(){for(var e,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];const a="Floating UI: "+t.join(" ");if(!((e=qn)!=null&&e.has(a))){var i;(i=qn)==null||i.add(a),console.warn(a)}}function qd(){for(var e,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];const a="Floating UI: "+t.join(" ");if(!((e=qn)!=null&&e.has(a))){var i;(i=qn)==null||i.add(a),console.error(a)}}const Hd=M.forwardRef(function(n,t){const{context:{placement:o,elements:{floating:a},middlewareData:{arrow:i,shift:s}},width:l=14,height:c=7,tipRadius:u=0,strokeWidth:_=0,staticOffset:g,stroke:f,d,style:{transform:m,...p}={},...v}=n;process.env.NODE_ENV!=="production"&&(t||Eo("The `ref` prop is required for `FloatingArrow`."));const y=jn(),[w,C]=M.useState(!1);if(He(()=>{if(!a)return;Ct(a).direction==="rtl"&&C(!0)},[a]),!a)return null;const[k,z]=o.split("-"),A=k==="top"||k==="bottom";let N=g;(A&&s!=null&&s.x||!A&&s!=null&&s.y)&&(N=null);const P=_*2,O=P/2,E=l/2*(u/-8+1),T=c/2*u/4,V=!!d,S=N&&z==="end"?"bottom":"top";let b=N&&z==="end"?"right":"left";N&&w&&(b=z==="end"?"left":"right");const x=i?.x!=null?N||i.x:"",F=i?.y!=null?N||i.y:"",I=d||"M0,0"+(" H"+l)+(" L"+(l-E)+","+(c-T))+(" Q"+l/2+","+c+" "+E+","+(c-T))+" Z",$={top:V?"rotate(180deg)":"",left:V?"rotate(90deg)":"rotate(-90deg)",bottom:V?"":"rotate(180deg)",right:V?"rotate(-90deg)":"rotate(90deg)"}[k];return r.jsxs("svg",{...v,"aria-hidden":!0,ref:t,width:V?l:l+P,height:l,viewBox:"0 0 "+l+" "+(c>l?c:l),style:{position:"absolute",pointerEvents:"none",[b]:x,[S]:F,[k]:A||V?"100%":"calc(100% - "+P/2+"px)",transform:[$,m].filter(D=>!!D).join(" "),...p},children:[P>0&&r.jsx("path",{clipPath:"url(#"+y+")",fill:"none",stroke:f,strokeWidth:P+(d?0:1),d:I}),r.jsx("path",{stroke:P&&!d?v.fill:"none",d:I}),r.jsx("clipPath",{id:y,children:r.jsx("rect",{x:-O,y:O*(V?-1:1),width:l+P,height:l})})]})});function Fi(){const e=new Map;return{emit(n,t){var o;(o=e.get(n))==null||o.forEach(a=>a(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 zi=M.createContext(null),Li=M.createContext(null),xn=()=>{var e;return((e=M.useContext(zi))==null?void 0:e.id)||null},cn=()=>M.useContext(Li);function Ai(e){const n=jn(),t=cn(),a=xn();return He(()=>{if(!n)return;const i={id:n,parentId:a};return t?.addNode(i),()=>{t?.removeNode(i)}},[t,n,a]),n}function Di(e){const{children:n,id:t}=e,o=xn();return r.jsx(zi.Provider,{value:M.useMemo(()=>({id:t,parentId:o}),[t,o]),children:n})}function Wd(e){const{children:n}=e,t=M.useRef([]),o=M.useCallback(s=>{t.current=[...t.current,s]},[]),a=M.useCallback(s=>{t.current=t.current.filter(l=>l!==s)},[]),[i]=M.useState(()=>Fi());return r.jsx(Li.Provider,{value:M.useMemo(()=>({nodesRef:t,addNode:o,removeNode:a,events:i}),[o,a,i]),children:n})}function dn(e){return"data-floating-ui-"+e}function _t(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Pi=dn("safe-polygon");function zr(e,n,t){if(t&&!Dn(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 Lr(e){return typeof e=="function"?e():e}function Ar(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,dataRef:a,events:i,elements:s}=e,{enabled:l=!0,delay:c=0,handleClose:u=null,mouseOnly:_=!1,restMs:g=0,move:f=!0}=n,d=cn(),m=xn(),p=st(u),v=st(c),y=st(t),w=st(g),C=M.useRef(),k=M.useRef(-1),z=M.useRef(),A=M.useRef(-1),N=M.useRef(!0),P=M.useRef(!1),O=M.useRef(()=>{}),E=M.useRef(!1),T=nt(()=>{var I;const $=(I=a.current.openEvent)==null?void 0:I.type;return $?.includes("mouse")&&$!=="mousedown"});M.useEffect(()=>{if(!l)return;function I($){let{open:D}=$;D||(_t(k),_t(A),N.current=!0,E.current=!1)}return i.on("openchange",I),()=>{i.off("openchange",I)}},[l,i]),M.useEffect(()=>{if(!l||!p.current||!t)return;function I(D){T()&&o(!1,D,"hover")}const $=dt(s.floating).documentElement;return $.addEventListener("mouseleave",I),()=>{$.removeEventListener("mouseleave",I)}},[s.floating,t,o,l,p,T]);const V=M.useCallback(function(I,$,D){$===void 0&&($=!0),D===void 0&&(D="hover");const B=zr(v.current,"close",C.current);B&&!z.current?(_t(k),k.current=window.setTimeout(()=>o(!1,I,D),B)):$&&(_t(k),o(!1,I,D))},[v,o]),S=nt(()=>{O.current(),z.current=void 0}),b=nt(()=>{if(P.current){const I=dt(s.floating).body;I.style.pointerEvents="",I.removeAttribute(Pi),P.current=!1}}),x=nt(()=>a.current.openEvent?["click","mousedown"].includes(a.current.openEvent.type):!1);M.useEffect(()=>{if(!l)return;function I(U){if(_t(k),N.current=!1,_&&!Dn(C.current)||Lr(w.current)>0&&!zr(v.current,"open"))return;const L=zr(v.current,"open",C.current);L?k.current=window.setTimeout(()=>{y.current||o(!0,U,"hover")},L):t||o(!0,U,"hover")}function $(U){if(x()){b();return}O.current();const L=dt(s.floating);if(_t(A),E.current=!1,p.current&&a.current.floatingContext){t||_t(k),z.current=p.current({...a.current.floatingContext,tree:d,x:U.clientX,y:U.clientY,onClose(){b(),S(),x()||V(U,!0,"safe-polygon")}});const W=z.current;L.addEventListener("mousemove",W),O.current=()=>{L.removeEventListener("mousemove",W)};return}(C.current==="touch"?!ct(s.floating,U.relatedTarget):!0)&&V(U)}function D(U){x()||a.current.floatingContext&&(p.current==null||p.current({...a.current.floatingContext,tree:d,x:U.clientX,y:U.clientY,onClose(){b(),S(),x()||V(U)}})(U))}function B(){_t(k)}function X(U){x()||V(U,!1)}if(qe(s.domReference)){const U=s.domReference,L=s.floating;return t&&U.addEventListener("mouseleave",D),f&&U.addEventListener("mousemove",I,{once:!0}),U.addEventListener("mouseenter",I),U.addEventListener("mouseleave",$),L&&(L.addEventListener("mouseleave",D),L.addEventListener("mouseenter",B),L.addEventListener("mouseleave",X)),()=>{t&&U.removeEventListener("mouseleave",D),f&&U.removeEventListener("mousemove",I),U.removeEventListener("mouseenter",I),U.removeEventListener("mouseleave",$),L&&(L.removeEventListener("mouseleave",D),L.removeEventListener("mouseenter",B),L.removeEventListener("mouseleave",X))}}},[s,l,e,_,f,V,S,b,o,t,y,d,v,p,a,x,w]),He(()=>{var I;if(l&&t&&(I=p.current)!=null&&(I=I.__options)!=null&&I.blockPointerEvents&&T()){P.current=!0;const D=s.floating;if(qe(s.domReference)&&D){var $;const B=dt(s.floating).body;B.setAttribute(Pi,"");const X=s.domReference,U=d==null||($=d.nodesRef.current.find(L=>L.id===m))==null||($=$.context)==null?void 0:$.elements.floating;return U&&(U.style.pointerEvents=""),B.style.pointerEvents="none",X.style.pointerEvents="auto",D.style.pointerEvents="auto",()=>{B.style.pointerEvents="",X.style.pointerEvents="",D.style.pointerEvents=""}}}},[l,t,m,s,d,p,T]),He(()=>{t||(C.current=void 0,E.current=!1,S(),b())},[t,S,b]),M.useEffect(()=>()=>{S(),_t(k),_t(A),b()},[l,s.domReference,S,b]);const F=M.useMemo(()=>{function I($){C.current=$.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove($){const{nativeEvent:D}=$;function B(){!N.current&&!y.current&&o(!0,D,"hover")}_&&!Dn(C.current)||t||Lr(w.current)===0||E.current&&$.movementX**2+$.movementY**2<2||(_t(A),C.current==="touch"?B():(E.current=!0,A.current=window.setTimeout(B,Lr(w.current))))}}},[_,o,t,y,w]);return M.useMemo(()=>l?{reference:F}:{},[l,F])}let Ti=0;function un(e,n){n===void 0&&(n={});const{preventScroll:t=!1,cancelPrevious:o=!0,sync:a=!1}=n;o&&cancelAnimationFrame(Ti);const i=()=>e?.focus({preventScroll:t});a?i():Ti=requestAnimationFrame(i)}function Dr(e,n){if(!e||!n)return!1;const t=n.getRootNode==null?void 0:n.getRootNode();if(e.contains(n))return!0;if(t&&ao(t)){let o=n;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Gd(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Zd(e){return e?.ownerDocument||document}const $n={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Oi(e){return e==="inert"?$n.inert:e==="aria-hidden"?$n["aria-hidden"]:$n.none}let Mo=new WeakSet,Io={},Pr=0;const Ud=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Vi=e=>e&&(e.host||Vi(e.parentNode)),Kd=(e,n)=>n.map(t=>{if(e.contains(t))return t;const o=Vi(t);return e.contains(o)?o:null}).filter(t=>t!=null);function Xd(e,n,t,o){const a="data-floating-ui-inert",i=o?"inert":t?"aria-hidden":null,s=Kd(n,e),l=new Set,c=new Set(s),u=[];Io[a]||(Io[a]=new WeakMap);const _=Io[a];s.forEach(g),f(n),l.clear();function g(d){!d||l.has(d)||(l.add(d),d.parentNode&&g(d.parentNode))}function f(d){!d||c.has(d)||[].forEach.call(d.children,m=>{if(Kt(m)!=="script")if(l.has(m))f(m);else{const p=i?m.getAttribute(i):null,v=p!==null&&p!=="false",y=Oi(i),w=(y.get(m)||0)+1,C=(_.get(m)||0)+1;y.set(m,w),_.set(m,C),u.push(m),w===1&&v&&Mo.add(m),C===1&&m.setAttribute(a,""),!v&&i&&m.setAttribute(i,i==="inert"?"":"true")}})}return Pr++,()=>{u.forEach(d=>{const m=Oi(i),v=(m.get(d)||0)-1,y=(_.get(d)||0)-1;m.set(d,v),_.set(d,y),v||(!Mo.has(d)&&i&&d.removeAttribute(i),Mo.delete(d)),y||d.removeAttribute(a)}),Pr--,Pr||($n.inert=new WeakMap,$n["aria-hidden"]=new WeakMap,$n.none=new WeakMap,Mo=new WeakSet,Io={})}}function Bi(e,n,t){n===void 0&&(n=!1),t===void 0&&(t=!1);const o=Zd(e[0]).body;return Xd(e.concat(Array.from(o.querySelectorAll('[aria-live],[role="status"],output'))),o,n,t)}const Fo={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},zo=M.forwardRef(function(n,t){const[o,a]=M.useState();He(()=>{ei()&&a("button")},[]);const i={ref:t,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[dn("focus-guard")]:"",style:Fo};return r.jsx("span",{...n,...i})}),ji=M.createContext(null),qi=dn("portal");function Yd(e){e===void 0&&(e={});const{id:n,root:t}=e,o=jn(),a=Hi(),[i,s]=M.useState(null),l=M.useRef(null);return He(()=>()=>{i?.remove(),queueMicrotask(()=>{l.current=null})},[i]),He(()=>{if(!o||l.current)return;const c=n?document.getElementById(n):null;if(!c)return;const u=document.createElement("div");u.id=o,u.setAttribute(qi,""),c.appendChild(u),l.current=u,s(u)},[n,o]),He(()=>{if(t===null||!o||l.current)return;let c=t||a?.portalNode;c&&!_r(c)&&(c=c.current),c=c||document.body;let u=null;n&&(u=document.createElement("div"),u.id=n,c.appendChild(u));const _=document.createElement("div");_.id=o,_.setAttribute(qi,""),c=u||c,c.appendChild(_),l.current=_,s(_)},[n,t,o,a]),i}function Lo(e){const{children:n,id:t,root:o,preserveTabOrder:a=!0}=e,i=Yd({id:t,root:o}),[s,l]=M.useState(null),c=M.useRef(null),u=M.useRef(null),_=M.useRef(null),g=M.useRef(null),f=s?.modal,d=s?.open,m=!!s&&!s.modal&&s.open&&a&&!!(o||i);return M.useEffect(()=>{if(!i||!a||f)return;function p(v){i&&On(v)&&(v.type==="focusin"?di:od)(i)}return i.addEventListener("focusin",p,!0),i.addEventListener("focusout",p,!0),()=>{i.removeEventListener("focusin",p,!0),i.removeEventListener("focusout",p,!0)}},[i,a,f]),M.useEffect(()=>{i&&(d||di(i))},[d,i]),r.jsxs(ji.Provider,{value:M.useMemo(()=>({preserveTabOrder:a,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:_,afterInsideRef:g,portalNode:i,setFocusManagerState:l}),[a,i]),children:[m&&i&&r.jsx(zo,{"data-type":"outside",ref:c,onFocus:p=>{if(On(p,i)){var v;(v=_.current)==null||v.focus()}else{const y=s?s.domReference:null,w=ci(y);w?.focus()}}}),m&&i&&r.jsx("span",{"aria-owns":i.id,style:Fo}),i&&ar.createPortal(n,i),m&&i&&r.jsx(zo,{"data-type":"outside",ref:u,onFocus:p=>{if(On(p,i)){var v;(v=g.current)==null||v.focus()}else{const y=s?s.domReference:null,w=li(y);w?.focus(),s?.closeOnFocusOut&&s?.onOpenChange(!1,p.nativeEvent,"focus-out")}}})]})}const Hi=()=>M.useContext(ji);function Wi(e){return M.useMemo(()=>n=>{e.forEach(t=>{t&&(t.current=n)})},e)}const Jd=20;let Qt=[];function Tr(){Qt=Qt.filter(e=>e.isConnected)}function Qd(e){Tr(),e&&Kt(e)!=="body"&&(Qt.push(e),Qt.length>Jd&&(Qt=Qt.slice(-20)))}function Gi(){return Tr(),Qt[Qt.length-1]}function Rd(e){const n=Tn();return Ja(e,n)?e:ho(e,n)[0]||e}function Zi(e,n){var t;if(!n.current.includes("floating")&&!((t=e.getAttribute("role"))!=null&&t.includes("dialog")))return;const o=Tn(),i=Bc(e,o).filter(l=>{const c=l.getAttribute("data-tabindex")||"";return Ja(l,o)||l.hasAttribute("data-tabindex")&&!c.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 eu=M.forwardRef(function(n,t){return r.jsx("button",{...n,type:"button",ref:t,tabIndex:-1,style:Fo})});function Or(e){const{context:n,children:t,disabled:o=!1,order:a=["content"],guards:i=!0,initialFocus:s=0,returnFocus:l=!0,restoreFocus:c=!1,modal:u=!0,visuallyHiddenDismiss:_=!1,closeOnFocusOut:g=!0,outsideElementsInert:f=!1,getInsideElements:d=()=>[]}=e,{open:m,onOpenChange:p,events:v,dataRef:y,elements:{domReference:w,floating:C}}=n,k=nt(()=>{var R;return(R=y.current.floatingContext)==null?void 0:R.nodeId}),z=nt(d),A=typeof s=="number"&&s<0,N=kr(w)&&A,P=Ud(),O=P?i:!0,E=!O||P&&f,T=st(a),V=st(s),S=st(l),b=cn(),x=Hi(),F=M.useRef(null),I=M.useRef(null),$=M.useRef(!1),D=M.useRef(!1),B=M.useRef(-1),X=M.useRef(-1),U=x!=null,L=mo(C),j=nt(function(R){return R===void 0&&(R=L),R?ho(R,Tn()):[]}),W=nt(R=>{const se=j(R);return T.current.map(_e=>w&&_e==="reference"?w:L&&_e==="floating"?L:se).filter(Boolean).flat()});M.useEffect(()=>{if(o||!u)return;function R(_e){if(_e.key==="Tab"){ct(L,Dt(dt(L)))&&j().length===0&&!N&&ut(_e);const Se=W(),ge=Ht(_e);T.current[0]==="reference"&&ge===w&&(ut(_e),_e.shiftKey?un(Se[Se.length-1]):un(Se[1])),T.current[1]==="floating"&&ge===L&&_e.shiftKey&&(ut(_e),un(Se[0]))}}const se=dt(L);return se.addEventListener("keydown",R),()=>{se.removeEventListener("keydown",R)}},[o,w,L,u,T,N,j,W]),M.useEffect(()=>{if(o||!C)return;function R(se){const _e=Ht(se),ge=j().indexOf(_e);ge!==-1&&(B.current=ge)}return C.addEventListener("focusin",R),()=>{C.removeEventListener("focusin",R)}},[o,C,j]),M.useEffect(()=>{if(o||!g)return;function R(){D.current=!0,setTimeout(()=>{D.current=!1})}function se(ge){const le=ge.relatedTarget,he=ge.currentTarget,G=Ht(ge);queueMicrotask(()=>{const Y=k(),ce=!(ct(w,le)||ct(C,le)||ct(le,C)||ct(x?.portalNode,le)||le!=null&&le.hasAttribute(dn("focus-guard"))||b&&(sn(b.nodesRef.current,Y).find(K=>{var q,H;return ct((q=K.context)==null?void 0:q.elements.floating,le)||ct((H=K.context)==null?void 0:H.elements.domReference,le)})||oi(b.nodesRef.current,Y).find(K=>{var q,H,de;return[(q=K.context)==null?void 0:q.elements.floating,mo((H=K.context)==null?void 0:H.elements.floating)].includes(le)||((de=K.context)==null?void 0:de.elements.domReference)===le})));if(he===w&&L&&Zi(L,T),c&&he!==w&&!(G!=null&&G.isConnected)&&Dt(dt(L))===dt(L).body){tt(L)&&L.focus();const K=B.current,q=j(),H=q[K]||q[q.length-1]||L;tt(H)&&H.focus()}if(y.current.insideReactTree){y.current.insideReactTree=!1;return}(N||!u)&&le&&ce&&!D.current&&le!==Gi()&&($.current=!0,p(!1,ge,"focus-out"))})}const _e=!!(!b&&x);function Se(){_t(X),y.current.insideReactTree=!0,X.current=window.setTimeout(()=>{y.current.insideReactTree=!1})}if(C&&tt(w))return w.addEventListener("focusout",se),w.addEventListener("pointerdown",R),C.addEventListener("focusout",se),_e&&C.addEventListener("focusout",Se,!0),()=>{w.removeEventListener("focusout",se),w.removeEventListener("pointerdown",R),C.removeEventListener("focusout",se),_e&&C.removeEventListener("focusout",Se,!0)}},[o,w,C,L,u,b,x,p,g,c,j,N,k,T,y]);const ie=M.useRef(null),re=M.useRef(null),ae=Wi([ie,x?.beforeInsideRef]),me=Wi([re,x?.afterInsideRef]);M.useEffect(()=>{var R,se;if(o||!C)return;const _e=Array.from((x==null||(R=x.portalNode)==null?void 0:R.querySelectorAll("["+dn("portal")+"]"))||[]),ge=(se=(b?oi(b.nodesRef.current,k()):[]).find(G=>{var Y;return kr(((Y=G.context)==null?void 0:Y.elements.domReference)||null)}))==null||(se=se.context)==null?void 0:se.elements.domReference,le=[C,ge,..._e,...z(),F.current,I.current,ie.current,re.current,x?.beforeOutsideRef.current,x?.afterOutsideRef.current,T.current.includes("reference")||N?w:null].filter(G=>G!=null),he=u||N?Bi(le,!E,E):Bi(le);return()=>{he()}},[o,w,C,u,T,x,N,O,E,b,k,z]),He(()=>{if(o||!tt(L))return;const R=dt(L),se=Dt(R);queueMicrotask(()=>{const _e=W(L),Se=V.current,ge=(typeof Se=="number"?_e[Se]:Se.current)||L,le=ct(L,se);!A&&!le&&m&&un(ge,{preventScroll:ge===L})})},[o,m,L,A,W,V]),He(()=>{if(o||!L)return;const R=dt(L),se=Dt(R);Qd(se);function _e(le){let{reason:he,event:G,nested:Y}=le;if(["hover","safe-polygon"].includes(he)&&G.type==="mouseleave"&&($.current=!0),he==="outside-press")if(Y)$.current=!1;else if(ri(G)||ai(G))$.current=!1;else{let ce=!1;document.createElement("div").focus({get preventScroll(){return ce=!0,!1}}),ce?$.current=!1:$.current=!0}}v.on("openchange",_e);const Se=R.createElement("span");Se.setAttribute("tabindex","-1"),Se.setAttribute("aria-hidden","true"),Object.assign(Se.style,Fo),U&&w&&w.insertAdjacentElement("afterend",Se);function ge(){if(typeof S.current=="boolean"){const le=w||Gi();return le&&le.isConnected?le:Se}return S.current.current||Se}return()=>{v.off("openchange",_e);const le=Dt(R),he=ct(C,le)||b&&sn(b.nodesRef.current,k(),!1).some(Y=>{var ce;return ct((ce=Y.context)==null?void 0:ce.elements.floating,le)}),G=ge();queueMicrotask(()=>{const Y=Rd(G);S.current&&!$.current&&tt(Y)&&(!(Y!==le&&le!==R.body)||he)&&Y.focus({preventScroll:!0}),Se.remove()})}},[o,C,L,S,y,v,b,U,w,k]),M.useEffect(()=>(queueMicrotask(()=>{$.current=!1}),()=>{queueMicrotask(Tr)}),[o]),He(()=>{if(!o&&x)return x.setFocusManagerState({modal:u,closeOnFocusOut:g,open:m,onOpenChange:p,domReference:w}),()=>{x.setFocusManagerState(null)}},[o,x,u,m,p,g,w]),He(()=>{o||L&&Zi(L,T)},[o,L,T]);function ee(R){return o||!_||!u?null:r.jsx(eu,{ref:R==="start"?F:I,onClick:se=>p(!1,se.nativeEvent),children:typeof _=="string"?_:"Dismiss"})}const fe=!o&&O&&(u?!N:!0)&&(U||u);return r.jsxs(r.Fragment,{children:[fe&&r.jsx(zo,{"data-type":"inside",ref:ae,onFocus:R=>{if(u){const _e=W();un(a[0]==="reference"?_e[0]:_e[_e.length-1])}else if(x!=null&&x.preserveTabOrder&&x.portalNode)if($.current=!1,On(R,x.portalNode)){const _e=li(w);_e?.focus()}else{var se;(se=x.beforeOutsideRef.current)==null||se.focus()}}}),!N&&ee("start"),t,ee("end"),fe&&r.jsx(zo,{"data-type":"inside",ref:me,onFocus:R=>{if(u)un(W()[0]);else if(x!=null&&x.preserveTabOrder&&x.portalNode)if(g&&($.current=!0),On(R,x.portalNode)){const _e=ci(w);_e?.focus()}else{var se;(se=x.afterOutsideRef.current)==null||se.focus()}}})]})}function Ui(e){return tt(e.target)&&e.target.tagName==="BUTTON"}function tu(e){return tt(e.target)&&e.target.tagName==="A"}function Ki(e){return Sr(e)}function Xi(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,dataRef:a,elements:{domReference:i}}=e,{enabled:s=!0,event:l="click",toggle:c=!0,ignoreMouse:u=!1,keyboardHandlers:_=!0,stickIfOpen:g=!0}=n,f=M.useRef(),d=M.useRef(!1),m=M.useMemo(()=>({onPointerDown(p){f.current=p.pointerType},onMouseDown(p){const v=f.current;p.button===0&&l!=="click"&&(Dn(v,!0)&&u||(t&&c&&(!(a.current.openEvent&&g)||a.current.openEvent.type==="mousedown")?o(!1,p.nativeEvent,"click"):(p.preventDefault(),o(!0,p.nativeEvent,"click"))))},onClick(p){const v=f.current;if(l==="mousedown"&&f.current){f.current=void 0;return}Dn(v,!0)&&u||(t&&c&&(!(a.current.openEvent&&g)||a.current.openEvent.type==="click")?o(!1,p.nativeEvent,"click"):o(!0,p.nativeEvent,"click"))},onKeyDown(p){f.current=void 0,!(p.defaultPrevented||!_||Ui(p))&&(p.key===" "&&!Ki(i)&&(p.preventDefault(),d.current=!0),!tu(p)&&p.key==="Enter"&&o(!(t&&c),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!_||Ui(p)||Ki(i)||p.key===" "&&d.current&&(d.current=!1,o(!(t&&c),p.nativeEvent,"click"))}}),[a,i,l,u,_,o,t,g,c]);return M.useMemo(()=>s?{reference:m}:{},[s,m])}const nu={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ou={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Yi=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 Ao(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,elements:a,dataRef:i}=e,{enabled:s=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:_=!1,referencePressEvent:g="pointerdown",ancestorScroll:f=!1,bubbles:d,capture:m}=n,p=cn(),v=nt(typeof c=="function"?c:()=>!1),y=typeof c=="function"?v:c,w=M.useRef(!1),{escapeKey:C,outsidePress:k}=Yi(d),{escapeKey:z,outsidePress:A}=Yi(m),N=M.useRef(!1),P=nt(b=>{var x;if(!t||!s||!l||b.key!=="Escape"||N.current)return;const F=(x=i.current.floatingContext)==null?void 0:x.nodeId,I=p?sn(p.nodesRef.current,F):[];if(!C&&(b.stopPropagation(),I.length>0)){let $=!0;if(I.forEach(D=>{var B;if((B=D.context)!=null&&B.open&&!D.context.dataRef.current.__escapeKeyBubbles){$=!1;return}}),!$)return}o(!1,Kc(b)?b.nativeEvent:b,"escape-key")}),O=nt(b=>{var x;const F=()=>{var I;P(b),(I=Ht(b))==null||I.removeEventListener("keydown",F)};(x=Ht(b))==null||x.addEventListener("keydown",F)}),E=nt(b=>{var x;const F=i.current.insideReactTree;i.current.insideReactTree=!1;const I=w.current;if(w.current=!1,u==="click"&&I||F||typeof y=="function"&&!y(b))return;const $=Ht(b),D="["+dn("inert")+"]",B=dt(a.floating).querySelectorAll(D);let X=qe($)?$:null;for(;X&&!Bt(X);){const W=jt(X);if(Bt(W)||!qe(W))break;X=W}if(B.length&&qe($)&&!Gc($)&&!ct($,a.floating)&&Array.from(B).every(W=>!ct(X,W)))return;if(tt($)&&S){const W=Bt($),ie=Ct($),re=/auto|scroll/,ae=W||re.test(ie.overflowX),me=W||re.test(ie.overflowY),ee=ae&&$.clientWidth>0&&$.scrollWidth>$.clientWidth,fe=me&&$.clientHeight>0&&$.scrollHeight>$.clientHeight,R=ie.direction==="rtl",se=fe&&(R?b.offsetX<=$.offsetWidth-$.clientWidth:b.offsetX>$.clientWidth),_e=ee&&b.offsetY>$.clientHeight;if(se||_e)return}const U=(x=i.current.floatingContext)==null?void 0:x.nodeId,L=p&&sn(p.nodesRef.current,U).some(W=>{var ie;return $r(b,(ie=W.context)==null?void 0:ie.elements.floating)});if($r(b,a.floating)||$r(b,a.domReference)||L)return;const j=p?sn(p.nodesRef.current,U):[];if(j.length>0){let W=!0;if(j.forEach(ie=>{var re;if((re=ie.context)!=null&&re.open&&!ie.context.dataRef.current.__outsidePressBubbles){W=!1;return}}),!W)return}o(!1,b,"outside-press")}),T=nt(b=>{var x;const F=()=>{var I;E(b),(I=Ht(b))==null||I.removeEventListener(u,F)};(x=Ht(b))==null||x.addEventListener(u,F)});M.useEffect(()=>{if(!t||!s)return;i.current.__escapeKeyBubbles=C,i.current.__outsidePressBubbles=k;let b=-1;function x(B){o(!1,B,"ancestor-scroll")}function F(){window.clearTimeout(b),N.current=!0}function I(){b=window.setTimeout(()=>{N.current=!1},so()?5:0)}const $=dt(a.floating);l&&($.addEventListener("keydown",z?O:P,z),$.addEventListener("compositionstart",F),$.addEventListener("compositionend",I)),y&&$.addEventListener(u,A?T:E,A);let D=[];return f&&(qe(a.domReference)&&(D=Xt(a.domReference)),qe(a.floating)&&(D=D.concat(Xt(a.floating))),!qe(a.reference)&&a.reference&&a.reference.contextElement&&(D=D.concat(Xt(a.reference.contextElement)))),D=D.filter(B=>{var X;return B!==((X=$.defaultView)==null?void 0:X.visualViewport)}),D.forEach(B=>{B.addEventListener("scroll",x,{passive:!0})}),()=>{l&&($.removeEventListener("keydown",z?O:P,z),$.removeEventListener("compositionstart",F),$.removeEventListener("compositionend",I)),y&&$.removeEventListener(u,A?T:E,A),D.forEach(B=>{B.removeEventListener("scroll",x)}),window.clearTimeout(b)}},[i,a,l,y,u,t,o,f,s,C,k,P,z,O,E,A,T]),M.useEffect(()=>{i.current.insideReactTree=!1},[i,y,u]);const V=M.useMemo(()=>({onKeyDown:P,..._&&{[nu[g]]:b=>{o(!1,b.nativeEvent,"reference-press")},...g!=="click"&&{onClick(b){o(!1,b.nativeEvent,"reference-press")}}}}),[P,o,_,g]),S=M.useMemo(()=>({onKeyDown:P,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[ou[u]]:()=>{i.current.insideReactTree=!0}}),[P,u,i]);return M.useMemo(()=>s?{reference:V,floating:S}:{},[s,V,S])}function ru(e){const{open:n=!1,onOpenChange:t,elements:o}=e,a=jn(),i=M.useRef({}),[s]=M.useState(()=>Fi()),l=xn()!=null;if(process.env.NODE_ENV!=="production"){const d=o.reference;d&&!qe(d)&&qd("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[c,u]=M.useState(o.reference),_=nt((d,m,p)=>{i.current.openEvent=d?m:void 0,s.emit("openchange",{open:d,event:m,reason:p,nested:l}),t?.(d,m,p)}),g=M.useMemo(()=>({setPositionReference:u}),[]),f=M.useMemo(()=>({reference:c||o.reference||null,floating:o.floating||null,domReference:o.reference}),[c,o.reference,o.floating]);return M.useMemo(()=>({dataRef:i,open:n,onOpenChange:_,elements:f,events:s,floatingId:a,refs:g}),[n,_,f,s,a,g])}function Do(e){e===void 0&&(e={});const{nodeId:n}=e,t=ru({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||t,a=o.elements,[i,s]=M.useState(null),[l,c]=M.useState(null),_=a?.domReference||i,g=M.useRef(null),f=cn();He(()=>{_&&(g.current=_)},[_]);const d=Dd({...e,elements:{...a,...l&&{reference:l}}}),m=M.useCallback(C=>{const k=qe(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),getClientRects:()=>C.getClientRects(),contextElement:C}:C;c(k),d.refs.setReference(k)},[d.refs]),p=M.useCallback(C=>{(qe(C)||C===null)&&(g.current=C,s(C)),(qe(d.refs.reference.current)||d.refs.reference.current===null||C!==null&&!qe(C))&&d.refs.setReference(C)},[d.refs]),v=M.useMemo(()=>({...d.refs,setReference:p,setPositionReference:m,domReference:g}),[d.refs,p,m]),y=M.useMemo(()=>({...d.elements,domReference:_}),[d.elements,_]),w=M.useMemo(()=>({...d,...o,refs:v,elements:y,nodeId:n}),[d,v,y,n,o]);return He(()=>{o.dataRef.current.floatingContext=w;const C=f?.nodesRef.current.find(k=>k.id===n);C&&(C.context=w)}),M.useMemo(()=>({...d,context:w,refs:v,elements:y}),[d,v,y,w])}function Vr(){return jc()&&ei()}function au(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,events:a,dataRef:i,elements:s}=e,{enabled:l=!0,visibleOnly:c=!0}=n,u=M.useRef(!1),_=M.useRef(-1),g=M.useRef(!0);M.useEffect(()=>{if(!l)return;const d=vt(s.domReference);function m(){!t&&tt(s.domReference)&&s.domReference===Dt(dt(s.domReference))&&(u.current=!0)}function p(){g.current=!0}function v(){g.current=!1}return d.addEventListener("blur",m),Vr()&&(d.addEventListener("keydown",p,!0),d.addEventListener("pointerdown",v,!0)),()=>{d.removeEventListener("blur",m),Vr()&&(d.removeEventListener("keydown",p,!0),d.removeEventListener("pointerdown",v,!0))}},[s.domReference,t,l]),M.useEffect(()=>{if(!l)return;function d(m){let{reason:p}=m;(p==="reference-press"||p==="escape-key")&&(u.current=!0)}return a.on("openchange",d),()=>{a.off("openchange",d)}},[a,l]),M.useEffect(()=>()=>{_t(_)},[]);const f=M.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(d){if(u.current)return;const m=Ht(d.nativeEvent);if(c&&qe(m)){if(Vr()&&!d.relatedTarget){if(!g.current&&!Sr(m))return}else if(!Zc(m))return}o(!0,d.nativeEvent,"focus")},onBlur(d){u.current=!1;const m=d.relatedTarget,p=d.nativeEvent,v=qe(m)&&m.hasAttribute(dn("focus-guard"))&&m.getAttribute("data-type")==="outside";_.current=window.setTimeout(()=>{var y;const w=Dt(s.domReference?s.domReference.ownerDocument:document);!m&&w===s.domReference||ct((y=i.current.floatingContext)==null?void 0:y.refs.floating.current,w)||ct(s.domReference,w)||v||o(!1,p,"focus")})}}),[i,s.domReference,o,c]);return M.useMemo(()=>l?{reference:f}:{},[l,f])}function Br(e,n,t){const o=new Map,a=t==="item";let i=e;if(a&&e){const{[ki]:s,[Ni]:l,...c}=e;i=c}return{...t==="floating"&&{tabIndex:-1,[Od]:""},...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(c=>{let[u,_]=c;if(!(a&&[ki,Ni].includes(u)))if(u.indexOf("on")===0){if(o.has(u)||o.set(u,[]),typeof _=="function"){var g;(g=o.get(u))==null||g.push(_),s[u]=function(){for(var f,d=arguments.length,m=new Array(d),p=0;p<d;p++)m[p]=arguments[p];return(f=o.get(u))==null?void 0:f.map(v=>v(...m)).find(v=>v!==void 0)}}}else s[u]=_}),s),{})}}function Po(e){e===void 0&&(e=[]);const n=e.map(l=>l?.reference),t=e.map(l=>l?.floating),o=e.map(l=>l?.item),a=M.useCallback(l=>Br(l,e,"reference"),n),i=M.useCallback(l=>Br(l,e,"floating"),t),s=M.useCallback(l=>Br(l,e,"item"),o);return M.useMemo(()=>({getReferenceProps:a,getFloatingProps:i,getItemProps:s}),[a,i,s])}const iu="Escape";function To(e,n,t){switch(e){case"vertical":return n;case"horizontal":return t;default:return n||t}}function Oo(e,n){return To(n,e===Ei||e===No,e===Vn||e===Bn)}function jr(e,n,t){return To(n,e===No,t?e===Vn:e===Bn)||e==="Enter"||e===" "||e===""}function Ji(e,n,t){return To(n,t?e===Vn:e===Bn,e===No)}function Qi(e,n,t,o){const a=t?e===Bn:e===Vn,i=e===Ei;return n==="both"||n==="horizontal"&&o&&o>1?e===iu:To(n,a,i)}function qr(e,n){const{open:t,onOpenChange:o,elements:a,floatingId:i}=e,{listRef:s,activeIndex:l,onNavigate:c=()=>{},enabled:u=!0,selectedIndex:_=null,allowEscape:g=!1,loop:f=!1,nested:d=!1,rtl:m=!1,virtual:p=!1,focusItemOnOpen:v="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:w=!0,disabledIndices:C=void 0,orientation:k="vertical",parentOrientation:z,cols:A=1,scrollItemIntoView:N=!0,virtualItemRef:P,itemSizes:O,dense:E=!1}=n;process.env.NODE_ENV!=="production"&&(g&&(f||Eo("`useListNavigation` looping must be enabled to allow escaping."),p||Eo("`useListNavigation` must be virtual to allow escaping.")),k==="vertical"&&A>1&&Eo("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const T=mo(a.floating),V=st(T),S=xn(),b=cn();He(()=>{e.dataRef.current.orientation=k},[e,k]);const x=nt(()=>{c($.current===-1?null:$.current)}),F=kr(a.domReference),I=M.useRef(v),$=M.useRef(_??-1),D=M.useRef(null),B=M.useRef(!0),X=M.useRef(x),U=M.useRef(!!a.floating),L=M.useRef(t),j=M.useRef(!1),W=M.useRef(!1),ie=st(C),re=st(t),ae=st(N),me=st(_),[ee,fe]=M.useState(),[R,se]=M.useState(),_e=nt(()=>{function K(te){if(p){var pe;(pe=te.id)!=null&&pe.endsWith("-fui-option")&&(te.id=i+"-"+Math.random().toString(16).slice(2,10)),fe(te.id),b?.events.emit("virtualfocus",te),P&&(P.current=te)}else un(te,{sync:j.current,preventScroll:!0})}const q=s.current[$.current],H=W.current;q&&K(q),(j.current?te=>te():requestAnimationFrame)(()=>{const te=s.current[$.current]||q;if(!te)return;q||K(te);const pe=ae.current;pe&&ge&&(H||!B.current)&&(te.scrollIntoView==null||te.scrollIntoView(typeof pe=="boolean"?{block:"nearest",inline:"nearest"}:pe))})});He(()=>{u&&(t&&a.floating?I.current&&_!=null&&(W.current=!0,$.current=_,x()):U.current&&($.current=-1,X.current()))},[u,t,a.floating,_,x]),He(()=>{if(u&&t&&a.floating)if(l==null){if(j.current=!1,me.current!=null)return;if(U.current&&($.current=-1,_e()),(!L.current||!U.current)&&I.current&&(D.current!=null||I.current===!0&&D.current==null)){let K=0;const q=()=>{s.current[0]==null?(K<2&&(K?requestAnimationFrame:queueMicrotask)(q),K++):($.current=D.current==null||jr(D.current,k,m)||d?Nr(s,ie.current):ii(s,ie.current),D.current=null,x())};q()}}else Pn(s,l)||($.current=l,_e(),W.current=!1)},[u,t,a.floating,l,me,d,s,k,m,x,_e,ie]),He(()=>{var K;if(!u||a.floating||!b||p||!U.current)return;const q=b.nodesRef.current,H=(K=q.find(pe=>pe.id===S))==null||(K=K.context)==null?void 0:K.elements.floating,de=Dt(dt(a.floating)),te=q.some(pe=>pe.context&&ct(pe.context.elements.floating,de));H&&!te&&B.current&&H.focus({preventScroll:!0})},[u,a.floating,b,S,p]),He(()=>{if(!u||!b||!p||S)return;function K(q){se(q.id),P&&(P.current=q)}return b.events.on("virtualfocus",K),()=>{b.events.off("virtualfocus",K)}},[u,b,p,S,P]),He(()=>{X.current=x,L.current=t,U.current=!!a.floating}),He(()=>{t||(D.current=null,I.current=v)},[t,v]);const Se=l!=null,ge=M.useMemo(()=>{function K(H){if(!re.current)return;const de=s.current.indexOf(H);de!==-1&&$.current!==de&&($.current=de,x())}return{onFocus(H){let{currentTarget:de}=H;j.current=!0,K(de)},onClick:H=>{let{currentTarget:de}=H;return de.focus({preventScroll:!0})},onMouseMove(H){let{currentTarget:de}=H;j.current=!0,W.current=!1,y&&K(de)},onPointerLeave(H){let{pointerType:de}=H;if(!(!B.current||de==="touch")&&(j.current=!0,!!y&&($.current=-1,x(),!p))){var te;(te=V.current)==null||te.focus({preventScroll:!0})}}}},[re,V,y,s,x,p]),le=M.useCallback(()=>{var K;return z??(b==null||(K=b.nodesRef.current.find(q=>q.id===S))==null||(K=K.context)==null||(K=K.dataRef)==null?void 0:K.current.orientation)},[S,b,z]),he=nt(K=>{if(B.current=!1,j.current=!0,K.which===229||!re.current&&K.currentTarget===V.current)return;if(d&&Qi(K.key,k,m,A)){Oo(K.key,le())||ut(K),o(!1,K.nativeEvent,"list-navigation"),tt(a.domReference)&&(p?b?.events.emit("virtualfocus",a.domReference):a.domReference.focus());return}const q=$.current,H=Nr(s,C),de=ii(s,C);if(F||(K.key==="Home"&&(ut(K),$.current=H,x()),K.key==="End"&&(ut(K),$.current=de,x())),A>1){const te=O||Array.from({length:s.current.length},()=>({width:1,height:1})),pe=ed(te,A,E),Ye=pe.findIndex(Ne=>Ne!=null&&!bo(s,Ne,C)),Oe=pe.reduce((Ne,ot,Me)=>ot!=null&&!bo(s,ot,C)?Me:Ne,-1),Ae=pe[Rc({current:pe.map(Ne=>Ne!=null?s.current[Ne]:null)},{event:K,orientation:k,loop:f,rtl:m,cols:A,disabledIndices:nd([...(typeof C!="function"?C:null)||s.current.map((Ne,ot)=>bo(s,ot,C)?ot:void 0),void 0],pe),minIndex:Ye,maxIndex:Oe,prevIndex:td($.current>de?H:$.current,te,pe,A,K.key===No?"bl":K.key===(m?Vn:Bn)?"tr":"tl"),stopEvent:!0})];if(Ae!=null&&($.current=Ae,x()),k==="both")return}if(Oo(K.key,k)){if(ut(K),t&&!p&&Dt(K.currentTarget.ownerDocument)===K.currentTarget){$.current=jr(K.key,k,m)?H:de,x();return}jr(K.key,k,m)?f?$.current=q>=de?g&&q!==s.current.length?-1:H:ft(s,{startingIndex:q,disabledIndices:C}):$.current=Math.min(de,ft(s,{startingIndex:q,disabledIndices:C})):f?$.current=q<=H?g&&q!==-1?s.current.length:de:ft(s,{startingIndex:q,decrement:!0,disabledIndices:C}):$.current=Math.max(H,ft(s,{startingIndex:q,decrement:!0,disabledIndices:C})),Pn(s,$.current)&&($.current=-1),x()}}),G=M.useMemo(()=>p&&t&&Se&&{"aria-activedescendant":R||ee},[p,t,Se,R,ee]),Y=M.useMemo(()=>({"aria-orientation":k==="both"?void 0:k,...F?{}:G,onKeyDown:he,onPointerMove(){B.current=!0}}),[G,he,k,F]),ce=M.useMemo(()=>{function K(H){v==="auto"&&ri(H.nativeEvent)&&(I.current=!0)}function q(H){I.current=v,v==="auto"&&ai(H.nativeEvent)&&(I.current=!0)}return{...G,onKeyDown(H){B.current=!1;const de=H.key.startsWith("Arrow"),te=["Home","End"].includes(H.key),pe=de||te,Ye=Ji(H.key,k,m),Oe=Qi(H.key,k,m,A),Ae=Ji(H.key,le(),m),Ne=Oo(H.key,k),ot=(d?Ae:Ne)||H.key==="Enter"||H.key.trim()==="";if(p&&t){const be=b?.nodesRef.current.find(lt=>lt.parentId==null),Ge=b&&be?Uc(b.nodesRef.current,be.id):null;if(pe&&Ge&&P){const lt=new KeyboardEvent("keydown",{key:H.key,bubbles:!0});if(Ye||Oe){var Me,bt;const Ee=((Me=Ge.context)==null?void 0:Me.elements.domReference)===H.currentTarget,rt=Oe&&!Ee?(bt=Ge.context)==null?void 0:bt.elements.domReference:Ye?s.current.find(St=>St?.id===ee):null;rt&&(ut(H),rt.dispatchEvent(lt),se(void 0))}if((Ne||te)&&Ge.context&&Ge.context.open&&Ge.parentId&&H.currentTarget!==Ge.context.elements.domReference){var Te;ut(H),(Te=Ge.context.elements.domReference)==null||Te.dispatchEvent(lt);return}}return he(H)}if(!(!t&&!w&&de)){if(ot){const be=Oo(H.key,le());D.current=d&&be?null:H.key}if(d){Ae&&(ut(H),t?($.current=Nr(s,ie.current),x()):o(!0,H.nativeEvent,"list-navigation"));return}Ne&&(_!=null&&($.current=_),ut(H),!t&&w?o(!0,H.nativeEvent,"list-navigation"):he(H),t&&x())}},onFocus(){t&&!p&&($.current=-1,x())},onPointerDown:q,onPointerEnter:q,onMouseDown:K,onClick:K}},[ee,G,A,he,ie,v,s,d,x,o,t,w,k,le,m,_,b,p,P]);return M.useMemo(()=>u?{reference:ce,floating:Y,item:ge}:{},[u,ce,Y,ge])}const su=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Vo(e,n){var t,o;n===void 0&&(n={});const{open:a,elements:i,floatingId:s}=e,{enabled:l=!0,role:c="dialog"}=n,u=jn(),_=((t=i.domReference)==null?void 0:t.id)||u,g=M.useMemo(()=>{var w;return((w=mo(i.floating))==null?void 0:w.id)||s},[i.floating,s]),f=(o=su.get(c))!=null?o:c,m=xn()!=null,p=M.useMemo(()=>f==="tooltip"||c==="label"?{["aria-"+(c==="label"?"labelledby":"describedby")]:a?g:void 0}:{"aria-expanded":a?"true":"false","aria-haspopup":f==="alertdialog"?"dialog":f,"aria-controls":a?g:void 0,...f==="listbox"&&{role:"combobox"},...f==="menu"&&{id:_},...f==="menu"&&m&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[f,g,m,a,_,c]),v=M.useMemo(()=>{const w={id:g,...f&&{role:f}};return f==="tooltip"||c==="label"?w:{...w,...f==="menu"&&{"aria-labelledby":_}}},[f,g,_,c]),y=M.useCallback(w=>{let{active:C,selected:k}=w;const z={role:"option",...C&&{id:g+"-fui-option"}};switch(c){case"select":case"combobox":return{...z,"aria-selected":k}}return{}},[g,c]);return M.useMemo(()=>l?{reference:p,floating:v,item:y}:{},[l,p,v,y])}const Ri=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 lu(e,n){const[t,o]=M.useState(e);return e&&!t&&o(!0),M.useEffect(()=>{if(!e&&t){const a=setTimeout(()=>o(!1),n);return()=>clearTimeout(a)}},[e,t,n]),t}function cu(e,n){n===void 0&&(n={});const{open:t,elements:{floating:o}}=e,{duration:a=250}=n,s=(typeof a=="number"?a:a.close)||0,[l,c]=M.useState("unmounted"),u=lu(t,s);return!u&&l==="close"&&c("unmounted"),He(()=>{if(o){if(t){c("initial");const _=requestAnimationFrame(()=>{ar.flushSync(()=>{c("open")})});return()=>{cancelAnimationFrame(_)}}c("close")}},[t,o]),{isMounted:u,status:l}}function Bo(e,n){n===void 0&&(n={});const{initial:t={opacity:0},open:o,close:a,common:i,duration:s=250}=n,l=e.placement,c=l.split("-")[0],u=M.useMemo(()=>({side:c,placement:l}),[c,l]),_=typeof s=="number",g=(_?s:s.open)||0,f=(_?s:s.close)||0,[d,m]=M.useState(()=>({...Sn(i,u),...Sn(t,u)})),{isMounted:p,status:v}=cu(e,{duration:s}),y=st(t),w=st(o),C=st(a),k=st(i);return He(()=>{const z=Sn(y.current,u),A=Sn(C.current,u),N=Sn(k.current,u),P=Sn(w.current,u)||Object.keys(z).reduce((O,E)=>(O[E]="",O),{});if(v==="initial"&&m(O=>({transitionProperty:O.transitionProperty,...N,...z})),v==="open"&&m({transitionProperty:Object.keys(P).map(Ri).join(","),transitionDuration:g+"ms",...N,...P}),v==="close"){const O=A||z;m({transitionProperty:Object.keys(O).map(Ri).join(","),transitionDuration:f+"ms",...N,...O})}},[f,C,y,w,k,g,v,u]),{isMounted:p,styles:d}}function es(e,n){var t;const{open:o,dataRef:a}=e,{listRef:i,activeIndex:s,onMatch:l,onTypingChange:c,enabled:u=!0,findMatch:_=null,resetMs:g=750,ignoreKeys:f=[],selectedIndex:d=null}=n,m=M.useRef(-1),p=M.useRef(""),v=M.useRef((t=d??s)!=null?t:-1),y=M.useRef(null),w=nt(l),C=nt(c),k=st(_),z=st(f);He(()=>{o&&(_t(m),y.current=null,p.current="")},[o]),He(()=>{if(o&&p.current===""){var E;v.current=(E=d??s)!=null?E:-1}},[o,d,s]);const A=nt(E=>{E?a.current.typing||(a.current.typing=E,C(E)):a.current.typing&&(a.current.typing=E,C(E))}),N=nt(E=>{function T(F,I,$){const D=k.current?k.current(I,$):I.find(B=>B?.toLocaleLowerCase().indexOf($.toLocaleLowerCase())===0);return D?F.indexOf(D):-1}const V=i.current;if(p.current.length>0&&p.current[0]!==" "&&(T(V,V,p.current)===-1?A(!1):E.key===" "&&ut(E)),V==null||z.current.includes(E.key)||E.key.length!==1||E.ctrlKey||E.metaKey||E.altKey)return;o&&E.key!==" "&&(ut(E),A(!0)),V.every(F=>{var I,$;return F?((I=F[0])==null?void 0:I.toLocaleLowerCase())!==(($=F[1])==null?void 0:$.toLocaleLowerCase()):!0})&&p.current===E.key&&(p.current="",v.current=y.current),p.current+=E.key,_t(m),m.current=window.setTimeout(()=>{p.current="",v.current=y.current,A(!1)},g);const b=v.current,x=T(V,[...V.slice((b||0)+1),...V.slice(0,(b||0)+1)],p.current);x!==-1?(w(x),y.current=x):E.key!==" "&&(p.current="",A(!1))}),P=M.useMemo(()=>({onKeyDown:N}),[N]),O=M.useMemo(()=>({onKeyDown:N,onKeyUp(E){E.key===" "&&A(!1)}}),[N,A]);return M.useMemo(()=>u?{reference:P,floating:O}:{},[u,P,O])}function ts(e,n,t){return t===void 0&&(t=!0),e.filter(a=>{var i;return a.parentId===n&&(!t||((i=a.context)==null?void 0:i.open))}).flatMap(a=>[a,...ts(e,a.id,t)])}function ns(e,n){const[t,o]=e;let a=!1;const i=n.length;for(let s=0,l=i-1;s<i;l=s++){const[c,u]=n[s]||[0,0],[_,g]=n[l]||[0,0];u>=o!=g>=o&&t<=(_-c)*(o-u)/(g-u)+c&&(a=!a)}return a}function du(e,n){return e[0]>=n.x&&e[0]<=n.x+n.width&&e[1]>=n.y&&e[1]<=n.y+n.height}function os(e){e===void 0&&(e={});const{buffer:n=.5,blockPointerEvents:t=!1,requireIntent:o=!0}=e,a={current:-1};let i=!1,s=null,l=null,c=typeof performance<"u"?performance.now():0;function u(g,f){const d=performance.now(),m=d-c;if(s===null||l===null||m===0)return s=g,l=f,c=d,null;const p=g-s,v=f-l,w=Math.sqrt(p*p+v*v)/m;return s=g,l=f,c=d,w}const _=g=>{let{x:f,y:d,placement:m,elements:p,onClose:v,nodeId:y,tree:w}=g;return function(k){function z(){_t(a),v()}if(_t(a),!p.domReference||!p.floating||m==null||f==null||d==null)return;const{clientX:A,clientY:N}=k,P=[A,N],O=Gd(k),E=k.type==="mouseleave",T=Dr(p.floating,O),V=Dr(p.domReference,O),S=p.domReference.getBoundingClientRect(),b=p.floating.getBoundingClientRect(),x=m.split("-")[0],F=f>b.right-b.width/2,I=d>b.bottom-b.height/2,$=du(P,S),D=b.width>S.width,B=b.height>S.height,X=(D?S:b).left,U=(D?S:b).right,L=(B?S:b).top,j=(B?S:b).bottom;if(T&&(i=!0,!E))return;if(V&&(i=!1),V&&!E){i=!0;return}if(E&&qe(k.relatedTarget)&&Dr(p.floating,k.relatedTarget)||w&&ts(w.nodesRef.current,y).length)return;if(x==="top"&&d>=S.bottom-1||x==="bottom"&&d<=S.top+1||x==="left"&&f>=S.right-1||x==="right"&&f<=S.left+1)return z();let W=[];switch(x){case"top":W=[[X,S.top+1],[X,b.bottom-1],[U,b.bottom-1],[U,S.top+1]];break;case"bottom":W=[[X,b.top+1],[X,S.bottom-1],[U,S.bottom-1],[U,b.top+1]];break;case"left":W=[[b.right-1,j],[b.right-1,L],[S.left+1,L],[S.left+1,j]];break;case"right":W=[[S.right-1,j],[S.right-1,L],[b.left+1,L],[b.left+1,j]];break}function ie(re){let[ae,me]=re;switch(x){case"top":{const ee=[D?ae+n/2:F?ae+n*4:ae-n*4,me+n+1],fe=[D?ae-n/2:F?ae+n*4:ae-n*4,me+n+1],R=[[b.left,F||D?b.bottom-n:b.top],[b.right,F?D?b.bottom-n:b.top:b.bottom-n]];return[ee,fe,...R]}case"bottom":{const ee=[D?ae+n/2:F?ae+n*4:ae-n*4,me-n],fe=[D?ae-n/2:F?ae+n*4:ae-n*4,me-n],R=[[b.left,F||D?b.top+n:b.bottom],[b.right,F?D?b.top+n:b.bottom:b.top+n]];return[ee,fe,...R]}case"left":{const ee=[ae+n+1,B?me+n/2:I?me+n*4:me-n*4],fe=[ae+n+1,B?me-n/2:I?me+n*4:me-n*4];return[...[[I||B?b.right-n:b.left,b.top],[I?B?b.right-n:b.left:b.right-n,b.bottom]],ee,fe]}case"right":{const ee=[ae-n,B?me+n/2:I?me+n*4:me-n*4],fe=[ae-n,B?me-n/2:I?me+n*4:me-n*4],R=[[I||B?b.left+n:b.right,b.top],[I?B?b.left+n:b.right:b.left+n,b.bottom]];return[ee,fe,...R]}}}if(!ns([A,N],W)){if(i&&!$)return z();if(!E&&o){const re=u(k.clientX,k.clientY);if(re!==null&&re<.1)return z()}ns([A,N],ie([f,d]))?!i&&o&&(a.current=window.setTimeout(z,40)):z()}}};return _.__options={blockPointerEvents:t},_}function kn(e,n,t){let o=t.initialDeps??[],a;function i(){var s,l,c,u;let _;t.key&&((s=t.debug)!=null&&s.call(t))&&(_=Date.now());const g=e();if(!(g.length!==o.length||g.some((m,p)=>o[p]!==m)))return a;o=g;let d;if(t.key&&((l=t.debug)!=null&&l.call(t))&&(d=Date.now()),a=n(...g),t.key&&((c=t.debug)!=null&&c.call(t))){const m=Math.round((Date.now()-_)*100)/100,p=Math.round((Date.now()-d)*100)/100,v=p/16,y=(w,C)=>{for(w=String(w);w.length<C;)w=" "+w;return w};console.info(`%c⏱ ${y(p,5)} /${y(m,5)} ms`,`
5
5
  font-size: .6rem;
6
6
  font-weight: bold;
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 s.updateDeps=a=>{o=a},s}function Bs(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Nd=(e,t)=>Math.abs(e-t)<1.01,Fd=(e,t,n)=>{let o;return function(...r){e.clearTimeout(o),o=e.setTimeout(()=>t.apply(this,r),n)}},Hs=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Ad=e=>e,Ld=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},Dd=(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(Hs(n)),!o.ResizeObserver)return()=>{};const s=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(Hs(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},Gs={passive:!0},Ws=typeof window>"u"?!0:"onscrollend"in window,zd=(e,t)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;let r=0;const s=e.options.useScrollendEvent&&Ws?()=>{}:Fd(o,()=>{t(r,!1)},e.options.isScrollingResetDelay),a=_=>()=>{const{horizontal:p,isRtl:f}=e.options;r=p?n.scrollLeft*(f&&-1||1):n.scrollTop,s(),t(r,_)},l=a(!0),d=a(!1);d(),n.addEventListener("scroll",l,Gs);const u=e.options.useScrollendEvent&&Ws;return u&&n.addEventListener("scrollend",d,Gs),()=>{n.removeEventListener("scroll",l),u&&n.removeEventListener("scrollend",d)}},Pd=(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"]},Td=(e,{adjustments:t=0,behavior:n},o)=>{var r,s;const a=e+t;(s=(r=o.scrollElement)==null?void 0:r.scrollTo)==null||s.call(r,{[o.options.horizontal?"left":"top"]:a,behavior:n})};class Od{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(s=>{const a=()=>{this._measureElement(s.target,s)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var r;(r=o())==null||r.disconnect(),n=null},observe:r=>{var s;return(s=o())==null?void 0:s.observe(r,{box:"border-box"})},unobserve:r=>{var s;return(s=o())==null?void 0:s.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:Ad,rangeExtractor:Ld,onChange:()=>{},measureElement:Pd,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=wt(()=>(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,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=s,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,s=new Map;for(let a=o-1;a>=0;a--){const l=n[a];if(r.has(l.lane))continue;const d=s.get(l.lane);if(d==null||l.end>d.end?s.set(l.lane,l):l.end<d.end&&r.set(l.lane,!0),r.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((a,l)=>a.end===l.end?a.index-l.index:a.end-l.end)[0]:void 0},this.getMeasurementOptions=wt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,o,r,s,a)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:o,scrollMargin:r,getItemKey:s,enabled:a}),{key:!1}),this.getMeasurements=wt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:o,scrollMargin:r,getItemKey:s,enabled:a},l)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(_=>{this.itemSizeCache.set(_.key,_.size)}));const d=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,d);for(let _=d;_<n;_++){const p=s(_),f=this.options.lanes===1?u[_-1]:this.getFurthestMeasurement(u,_),c=f?f.end+this.options.gap:o+r,h=l.get(p),g=typeof h=="number"?h:this.options.estimateSize(_),v=c+g,w=f?f.lane:_%this.options.lanes;u[_]={index:_,start:c,size:g,end:v,key:p,lane:w}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=wt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,o,r,s)=>this.range=n.length>0&&o>0?Vd({measurements:n,outerSize:o,scrollOffset:r,lanes:s}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=wt(()=>{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,s,a)=>s===null||a===null?[]:n({startIndex:s,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),s=this.measurementsCache[r];if(!s)return;const a=s.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 s=this.itemSizeCache.get(r.key)??r.size,a=o-s;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=wt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,o)=>{const r=[];for(let s=0,a=n.length;s<a;s++){const l=n[s],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 Bs(o[Ks(0,o.length-1,r=>Bs(o[r]).start,n)])},this.getOffsetForAlignment=(n,o,r=0)=>{const s=this.getSize(),a=this.getScrollOffset();o==="auto"&&(o=n>=a+s?"end":"start"),o==="center"?n+=(r-s)/2:o==="end"&&(n-=s);const l=this.getTotalSize()+this.options.scrollMargin-s;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 s=this.getSize(),a=this.getScrollOffset();if(o==="auto")if(r.end>=a+s-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 s=0;const a=10,l=u=>{if(!this.targetWindow)return;const _=this.getOffsetForIndex(n,u);if(!_){console.warn("Failed to get offset for index:",n);return}const[p,f]=_;this._scrollToOffset(p,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const c=this.getScrollOffset(),h=this.getOffsetForIndex(n,f);if(!h){console.warn("Failed to get offset for index:",n);return}Nd(h[0],c)||d(f)})},d=u=>{this.targetWindow&&(s++,s<a?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",s,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 s=Array(this.options.lanes).fill(null);let a=o.length-1;for(;a>=0&&s.some(l=>l===null);){const l=o[a];s[l.lane]===null&&(s[l.lane]=l.end),a--}r=Math.max(...s.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 Ks=(e,t,n,o)=>{for(;e<=t;){const r=(e+t)/2|0,s=n(r);if(s<o)e=r+1;else if(s>o)t=r-1;else return r}return e>0?e-1:0};function Vd({measurements:e,outerSize:t,scrollOffset:n,lanes:o}){const r=e.length-1,s=d=>e[d].start;if(e.length<=o)return{startIndex:0,endIndex:r};let a=Ks(0,r,s,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(_=>_<n+t);){const _=e[l];d[_.lane]=_.end,l++}const u=Array(o).fill(n+t);for(;a>=0&&u.some(_=>_>=n);){const _=e[a];u[_.lane]=_.start,a--}a=Math.max(0,a-a%o),l=Math.min(r,l+(o-1-l%o))}return{startIndex:a,endIndex:l}}const Us=typeof document<"u"?E.useLayoutEffect:E.useEffect;function qd(e){const t=E.useReducer(()=>({}),{})[1],n={...e,onChange:(r,s)=>{var a;s?St.flushSync(t):t(),(a=e.onChange)==null||a.call(e,r,s)}},[o]=E.useState(()=>new Od(n));return o.setOptions(n),Us(()=>o._didMount(),[]),Us(()=>o._willUpdate()),o}function jd(e){return qd({observeElementRect:Dd,observeElementOffset:zd,scrollToFn:Td,...e})}function Bd(e,t){const[n,o]=E.useState(e);return E.useEffect(()=>{const r=setTimeout(()=>{o(e)},t);return()=>{clearTimeout(r)}},[e,t]),n}function Ir(e){const t=E.useCallback(r=>{const s=window.matchMedia(e);return s.addEventListener("change",r),()=>{s.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 Er(e,t){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[t]??"":e)}function Tt(e,t){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[t]??"":e)}function No(e){return typeof e=="object"&&e!==null?!!e.disabled:!1}function Xs(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}function Ys(e,t,n,o){if(!t.trim())return e;const r=Xs(t.trim());return o?e.filter(s=>o(s,t)):e.filter(s=>Xs(Er(s,n)).includes(r))}function Hd(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 Gd(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 Wd(e,t,n,o){return t.trim()?e.map(r=>({...r,opciones:Ys(r.opciones,t,n,o)})).filter(r=>r.opciones.length>0):e}function Kd(e){return e.map((t,n)=>t.tipo==="grupo"||t.datos&&No(t.datos)?n:null).filter(t=>t!==null)}function Ud(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 Xd(e,t,n){return e!==void 0?e:t==="invalid"?!0:t==="valid"?!1:!!n}function Yd(e,t="Opción"){return Array.from({length:e},(n,o)=>`${t} ${o+1}`)}function Zd(e){return Array.from({length:e},(t,n)=>({id:`usr-${n+1}`,nombre:`Usuario ${n+1}`,email:`usuario${n+1}@test.com`}))}const Zs=({size:e="1em",...t})=>i.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:i.jsx("path",{d:"m6 9 6 6 6-6"})}),Js=({size:e="1em",...t})=>i.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:[i.jsx("path",{d:"M18 6 6 18"}),i.jsx("path",{d:"m6 6 12 12"})]}),Jd=({size:e="1em",...t})=>i.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:i.jsx("path",{d:"M20 6 9 17l-5-5"})}),Qd=({size:e="1em",...t})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",...t,children:[i.jsx("path",{fill:"currentColor",d:"M10 18a7.95 7.95 0 0 0 4.897-1.688l4.396 4.396l1.414-1.414l-4.396-4.396A7.95 7.95 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8s3.589 8 8 8m0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6s-6-2.691-6-6s2.691-6 6-6"}),i.jsx("path",{fill:"currentColor",d:"M11.412 8.586c.379.38.588.882.588 1.414h2a3.98 3.98 0 0 0-1.174-2.828c-1.514-1.512-4.139-1.512-5.652 0l1.412 1.416c.76-.758 2.07-.756 2.826-.002"})]}),Rd=({size:e="1em",...t})=>i.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:i.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),J={contenedor_base:"_contenedor_base_1uead_1",tam_sm:"_tam_sm_1uead_41",tam_lg:"_tam_lg_1uead_55",radio_none:"_radio_none_1uead_69",radio_sm:"_radio_sm_1uead_77",radio_md:"_radio_md_1uead_85",radio_lg:"_radio_lg_1uead_93",radio_full:"_radio_full_1uead_101",color_default:"_color_default_1uead_109",color_primary:"_color_primary_1uead_111",color_secondary:"_color_secondary_1uead_119",color_success:"_color_success_1uead_127",color_warning:"_color_warning_1uead_135",color_danger:"_color_danger_1uead_143",etiqueta:"_etiqueta_1uead_151",marca_requerido:"_marca_requerido_1uead_167",trigger:"_trigger_1uead_177",trigger_expandido:"_trigger_expandido_1uead_213",variante_bordered:"_variante_bordered_1uead_223",variante_faded:"_variante_faded_1uead_233",variante_underlined:"_variante_underlined_1uead_243",variante_ghost:"_variante_ghost_1uead_259",deshabilitado:"_deshabilitado_1uead_271",solo_lectura:"_solo_lectura_1uead_291",valor_texto:"_valor_texto_1uead_307",abierto:"_abierto_1uead_335",valido:"_valido_1uead_343",invalido:"_invalido_1uead_351",contenido_inicio:"_contenido_inicio_1uead_403",contenido_final:"_contenido_final_1uead_405",valor_wrapper:"_valor_wrapper_1uead_423",mostrar_todos:"_mostrar_todos_1uead_443",valor_wrapper_expandido:"_valor_wrapper_expandido_1uead_453",placeholder:"_placeholder_1uead_469",chip_multi:"_chip_multi_1uead_479",chip_texto:"_chip_texto_1uead_513",chip_cerrar:"_chip_cerrar_1uead_525",contador_multi:"_contador_multi_1uead_565",acciones:"_acciones_1uead_579",boton_limpiar:"_boton_limpiar_1uead_593",tiene_valor:"_tiene_valor_1uead_645",icono_chevron:"_icono_chevron_1uead_655",icono_spinner:"_icono_spinner_1uead_677",girarSpinner:"_girarSpinner_1uead_1",menu:"_menu_1uead_711",buscador_wrapper:"_buscador_wrapper_1uead_741",buscador_interno:"_buscador_interno_1uead_755",icono_buscar:"_icono_buscar_1uead_807",input_busqueda:"_input_busqueda_1uead_859",lista_opciones:"_lista_opciones_1uead_899",lista_virtual:"_lista_virtual_1uead_927",contenedor_virtual:"_contenedor_virtual_1uead_939",encabezado_grupo:"_encabezado_grupo_1uead_947",opcion_virtual:"_opcion_virtual_1uead_979",opcion:"_opcion_1uead_979",activo:"_activo_1uead_1023",seleccionado:"_seleccionado_1uead_1039",opcion_check:"_opcion_check_1uead_1079",opcion_contenido:"_opcion_contenido_1uead_1107",sin_resultados:"_sin_resultados_1uead_1123",descripcion:"_descripcion_1uead_1147",mensaje_error:"_mensaje_error_1uead_1159",ancho_total:"_ancho_total_1uead_1171",sin_animacion:"_sin_animacion_1uead_1179",contenedor_nativo:"_contenedor_nativo_1uead_1189",select_nativo:"_select_nativo_1uead_1197",input_validacion:"_input_validacion_1uead_1225"};function eu(e){const{options:t=[],value:n,onChange:o,onValueChange:r,optionLabelKey:s="label",optionValueKey:a="id",label:l,placeholder:d="Seleccione una opción",description:u,errorMessage:_,isRequired:p=!1,isInvalid:f,id:c,name:h,classNames:g,startContent:v,endContent:w,esInvalido:y,estaDeshabilitadoReal:x,clasesBase:k,renderizarValorMostrado:L}=e,A=m.useId(),M=c??`select-nativo-${A}`,T=u?`${M}-desc`:void 0,P=y?`${M}-err`:void 0,I=m.useCallback(D=>Er(D,s),[s]),q=m.useCallback(D=>Tt(D,a),[a]),V=m.useCallback(D=>{o?.(D),r?.(D)},[o,r]),S=m.useCallback(D=>{const N=D.target.value;if(!N){V(null);return}const C=t.find(z=>q(z)===N);C&&V(C)},[t,q,V]),b=typeof f=="string"?f:null,$=typeof _=="function"?_({invalido:y,mensaje:b}):_??b;return i.jsxs("div",{className:k,children:[l&&i.jsxs("label",{className:X(J.etiqueta,g?.label),htmlFor:M,children:[l,p&&i.jsx("span",{className:J.marca_requerido,children:"*"})]}),i.jsxs("div",{className:J.contenedor_nativo,children:[i.jsxs("div",{className:X(J.trigger,g?.trigger),children:[v&&i.jsx("span",{className:J.contenido_inicio,children:v}),i.jsx("div",{className:X(J.valor_wrapper,g?.value),children:L()}),i.jsxs("div",{className:J.acciones,children:[w&&i.jsx("span",{className:J.contenido_final,children:w}),i.jsx("span",{className:J.icono_chevron,children:i.jsx(Zs,{size:"1em"})})]})]}),i.jsxs("select",{id:M,name:h,className:J.select_nativo,value:n?q(n):"",onChange:S,disabled:x,required:p,children:[i.jsx("option",{value:"",children:d}),t.map(D=>i.jsx("option",{value:q(D),disabled:No(D),children:I(D)},q(D)))]})]}),u&&!y&&i.jsx("div",{id:T,className:X(J.descripcion,g?.description),children:u}),y&&$&&i.jsx("div",{id:P,className:X(J.mensaje_error,g?.errorMessage),children:$})]})}const nu="(max-width: 768px)",tu=44,Mr=320,Fo=100,ou=200,ru=5;function iu(e,t){const{options:n=[],value:o,defaultValue:r,onChange:s,onValueChange:a,optionLabelKey:l="label",optionValueKey:d="id",renderOption:u,renderValue:_,variant:p="bordered",color:f="default",size:c="md",radius:h="md",fullWidth:g=!0,disableAnimation:v=!1,label:w,placeholder:y="",description:x,errorMessage:k,emptyMessage:L="No hay opciones",noResultsMessage:A="Sin resultados",isRequired:M=!1,isDisabled:T=!1,isReadOnly:P=!1,isLoading:I=!1,isClearable:q=!0,isInvalid:V,validationState:S,isMultiple:b=!1,mostrarTodos:$=!1,isSearchable:D,isVirtualized:N=!1,estimatedOptionHeight:C=tu,filterFn:z,validate:O,onOpen:W,onClose:G,onSearchChange:F,onClear:j,onFocus:B,onBlur:te,id:Z,name:R,className:ge,classNames:fe,style:Ce,startContent:Q,endContent:se,menuZIndex:re,portalContainer:be}=e,le=m.useRef(null),ne=m.useRef([]),ue=m.useRef(null),we=m.useRef(null),oe=m.useId(),ye=Z??`select-${oe}`,U=Ir(nu),H=D??(n.length>4&&!U),K=U&&!H&&!b,[ie,pe]=m.useState(!1),[he,en]=m.useState(null),[Xe,De]=m.useState(""),Fe=o!==void 0,[rn,ke]=m.useState(r??null),me=Fe?o:rn,xe=T||I,je=m.useCallback(ee=>Er(ee,l),[l]),Ae=m.useCallback(ee=>Tt(ee,d),[d]),xn=m.useMemo(()=>{const ee=new Set;if(!me)return ee;try{if(b&&Array.isArray(me))for(const ze of me)ee.add(Tt(ze,d));else me&&ee.add(Tt(me,d))}catch{}return ee},[me,b,d]),Le=m.useCallback(ee=>{try{return xn.has(Tt(ee,d))}catch{return!1}},[xn,d]),Ye=m.useMemo(()=>Hd(n),[n]),$n=m.useMemo(()=>{if(!H||!Xe.trim())return n;try{return Ye?Wd(n,Xe,l,z):Ys(n,Xe,l,z)}catch{return n}},[n,Xe,H,z,l,Ye]),We=m.useMemo(()=>Ye?Gd($n):$n.map((ee,ze)=>({tipo:"opcion",datos:ee,indice:ze})),[$n,Ye]),_e=m.useMemo(()=>Ud(me,O),[me,O]),Ee=m.useMemo(()=>Xd(V,S,_e),[V,S,_e]),sn=S==="valid"&&!Ee,{refs:Ke,floatingStyles:bn,context:hn,placement:ti}=$o({open:ie,onOpenChange:ee=>{xe||P||(pe(ee),ee?(W?.(),De(""),en(null)):G?.())},strategy:"fixed",transform:!1,placement:"bottom-start",middleware:[_o(4),po({padding:8}),go({padding:8}),ls({apply({rects:ee,elements:ze}){Object.assign(ze.floating.style,{width:`${ee.reference.width}px`})},padding:8})],whileElementsMounted:co}),Ht=ti.startsWith("top"),{isMounted:oi,styles:Ie}=Mo(hn,{duration:v||We.length>ou?0:200,initial:{opacity:0,transform:Ht?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},open:{opacity:1,transform:"translateY(0) scale(1)"},close:{opacity:0,transform:Ht?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},common:{transformOrigin:Ht?"bottom":"top"}}),$e=jd({count:We.length,getScrollElement:()=>ue.current,estimateSize:()=>C,overscan:ru,enabled:N&&ie&&We.length>Fo}),Ue=Ls(hn,{enabled:!xe&&!P}),Sn=xo(hn),Ln=Eo(hn,{role:"listbox"}),ut=m.useMemo(()=>{try{return Kd(We)}catch{return[]}},[We]),Gt=kr(hn,{listRef:ne,activeIndex:he,onNavigate:en,loop:!0,virtual:N,focusItemOnHover:!H,disabledIndices:ut}),$t=m.useRef([]);m.useEffect(()=>{$t.current=We.map(ee=>ee.tipo==="opcion"&&ee.datos?je(ee.datos):null)},[We,je]);const Vo=Os(hn,{listRef:$t,activeIndex:he,onMatch:ie?en:void 0,enabled:!H}),{getReferenceProps:qo,getFloatingProps:s_,getItemProps:ja}=So([Ue,Sn,Ln,Gt,Vo]),Rn=m.useCallback(ee=>{Fe||ke(ee),s?.(ee),a?.(ee)},[Fe,s,a]),jo=m.useCallback(ee=>{if(!No(ee))if(b){const ze=Array.isArray(me)?me:[],Dn=ze.some(mn=>Ae(mn)===Ae(ee));Rn(Dn?ze.filter(mn=>Ae(mn)!==Ae(ee)):[...ze,ee])}else Rn(ee),pe(!1)},[b,me,Ae,Rn]),a_=m.useCallback(ee=>{ee.stopPropagation(),Rn(b?[]:null),j?.(),le.current?.focus()},[b,Rn,j]),Ba=m.useCallback((ee,ze)=>{ze.stopPropagation(),!(!b||!Array.isArray(me))&&Rn(me.filter(Dn=>Ae(Dn)!==Ae(ee)))},[b,me,Ae,Rn]),l_=m.useCallback(ee=>{const ze=ee.target.value;De(ze),F?.(ze),en(0)},[F]),c_=m.useCallback(ee=>{if(ee.key==="Enter"&&he!==null){ee.preventDefault();const ze=We[he];ze?.tipo==="opcion"&&ze.datos&&jo(ze.datos)}},[he,We,jo]);m.useEffect(()=>{ie&&H&&requestAnimationFrame(()=>we.current?.focus())},[ie,H]),m.useEffect(()=>{if(!ie)return;const ee=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",ee>0&&(document.body.style.paddingRight=`${ee}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[ie]),m.useEffect(()=>()=>{ne.current=[]},[We.length]),m.useImperativeHandle(t,()=>({focus:()=>le.current?.focus(),blur:()=>le.current?.blur(),open:()=>pe(!0),close:()=>pe(!1),clear:()=>Rn(b?[]:null)}));const Bo=b?Array.isArray(me)&&me.length>0:me!=null&&me!=="",Ha=m.useCallback(()=>{if(_)return _(me??null);if(!Bo)return i.jsx("span",{className:J.placeholder,children:y});if(b&&Array.isArray(me)){if(me.length===0)return i.jsx("span",{className:J.placeholder,children:y});const ee=$?me:me.slice(0,2),ze=$?0:Math.max(0,me.length-2);return i.jsxs(i.Fragment,{children:[ee.map(Dn=>i.jsxs("span",{className:J.chip_multi,children:[i.jsx("span",{className:J.chip_texto,children:je(Dn)}),!P&&!xe&&i.jsx("button",{type:"button",className:J.chip_cerrar,onClick:mn=>Ba(Dn,mn),children:i.jsx(Js,{size:"1em"})})]},Ae(Dn))),ze>0&&i.jsxs("span",{className:J.contador_multi,children:["+",ze]})]})}return i.jsx("span",{className:J.valor_texto,children:je(me)})},[_,me,Bo,y,b,$,P,xe,Ae,je,Ba]),Ga=m.useCallback((ee,ze,Dn)=>{try{if(ee.tipo==="grupo")return i.jsx("li",{className:X(J.encabezado_grupo,N&&J.opcion_virtual),style:Dn,children:ee.nombreGrupo},`grupo-${ee.nombreGrupo}`);const mn=ee.datos;if(!mn)return null;const Ua=Le(mn),Xa=he===ze,d_=No(mn),u_=u?u(mn,{isSelected:Ua,isActive:Xa}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:J.opcion_check,children:i.jsx(Jd,{size:"1em"})}),i.jsx("span",{className:J.opcion_contenido,children:je(mn)})]}),f_=Ae(mn);return i.jsx("li",{ref:__=>{ne.current[ze]=__},className:X(J.opcion,N&&J.opcion_virtual,{[J.activo]:Xa,[J.seleccionado]:Ua,[J.deshabilitado]:d_},fe?.option),style:Dn,...ja({onClick:()=>jo(mn)}),children:u_},f_)}catch(mn){return console.error("Error rendering select item:",mn),null}},[N,he,Le,u,je,Ae,fe?.option,ja,jo]),Wa=typeof k=="function"?k({invalido:Ee,mensaje:_e}):k??_e,Ka=X(J.contenedor_base,J[`variante_${p}`],J[`tam_${c}`],J[`radio_${h}`],J[`color_${f}`],{[J.ancho_total]:g,[J.sin_animacion]:v,[J.deshabilitado]:xe,[J.solo_lectura]:P,[J.invalido]:Ee,[J.valido]:sn,[J.abierto]:ie,[J.tiene_valor]:Bo},fe?.base,ge);return K&&!Ye?i.jsx(eu,{...e,esInvalido:Ee,estaDeshabilitadoReal:xe,clasesBase:Ka,renderizarValorMostrado:Ha}):i.jsxs("div",{className:Ka,style:Ce,children:[w&&i.jsxs("label",{id:`${ye}-label`,className:X(J.etiqueta,fe?.label),children:[w,M&&i.jsx("span",{className:J.marca_requerido,children:"*"})]}),i.jsxs("div",{ref:ee=>{Ke.setReference(ee),le.current=ee},id:ye,tabIndex:xe?-1:0,className:X(J.trigger,$&&b&&J.trigger_expandido,fe?.trigger),"aria-labelledby":w?`${ye}-label`:void 0,onFocus:B,onBlur:te,...qo(),children:[Q&&i.jsx("span",{className:J.contenido_inicio,children:Q}),i.jsx("div",{className:X(J.valor_wrapper,$&&b&&J.mostrar_todos,$&&b&&J.valor_wrapper_expandido,fe?.value),children:Ha()}),i.jsxs("div",{className:J.acciones,children:[q&&Bo&&!P&&!xe&&i.jsx("button",{type:"button",className:X(J.boton_limpiar,fe?.clearButton),onClick:a_,tabIndex:-1,children:i.jsx(Js,{size:"1em"})}),se&&i.jsx("span",{className:J.contenido_final,children:se}),I?i.jsx("span",{className:J.icono_spinner,children:i.jsx(Rd,{size:"1em"})}):i.jsx("span",{className:J.icono_chevron,children:i.jsx(Zs,{size:"1em"})})]})]}),(R||M)&&i.jsx("input",{type:"text",name:R,required:M,value:b&&Array.isArray(me)?me.map(Ae).join(","):me?Ae(me):"",onChange:()=>{},onFocus:ee=>ee.target.blur(),"aria-hidden":"true",className:J.input_validacion}),oi&&i.jsx(Co,{root:be,children:i.jsx(Cr,{context:hn,modal:!1,initialFocus:H?we:-1,children:i.jsxs("div",{ref:Ke.setFloating,style:{...bn,...Ie,zIndex:re??"var(--z-popover)"},className:X(J.menu,fe?.menu),...s_(),children:[H&&i.jsx("div",{className:J.buscador_wrapper,children:i.jsxs("div",{className:J.buscador_interno,children:[i.jsx("span",{className:J.icono_buscar,children:i.jsx(Qd,{size:"1.6em"})}),i.jsx("input",{ref:we,type:"text",className:X(J.input_busqueda,fe?.searchInput),placeholder:"Buscar...",value:Xe,onChange:l_,onKeyDown:c_})]})}),i.jsx("ul",{ref:ue,className:X(J.lista_opciones,N&&J.lista_virtual),style:{height:N&&We.length>Fo?`${Mr}px`:`${Math.min(We.length*C,Mr)}px`,maxHeight:`${Mr}px`,overflow:"auto",position:N&&We.length>Fo?"relative":void 0},children:We.length===0?i.jsx("li",{className:J.sin_resultados,children:Xe?A:L}):N&&We.length>Fo?i.jsx(i.Fragment,{children:i.jsx("div",{style:{height:`${$e.getTotalSize()}px`,position:"relative",width:"100%"},children:$e.getVirtualItems().map(ee=>{const ze=We[ee.index];return ze?i.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,width:"100%",height:`${ee.size}px`,transform:`translateY(${ee.start}px)`},children:Ga(ze,ee.index)},`virtual-${ee.index}`):null})})}):We.map((ee,ze)=>Ga(ee,ze))})]})})}),x&&!Ee&&i.jsx("div",{className:X(J.descripcion,fe?.description),children:x}),Ee&&Wa&&i.jsx("div",{className:X(J.mensaje_error,fe?.errorMessage),children:Wa})]})}const su=m.forwardRef(iu),Qs=m.memo(su);Qs.displayName="SelectBase";function au(e,t){const{options:n=[],value:o,onChange:r,onValueChange:s,optionValueKey:a,optionLabelKey:l="label",isMultiple:d=!1,devolverObjeto:u=!1,..._}=e,p=m.useMemo(()=>n.length>0&&typeof n[0]=="object",[n]),f=m.useMemo(()=>{if(!p||!a)return null;const g=new Map;for(const v of n)g.set(String(v[a]),v);return g},[n,a,p]),c=m.useMemo(()=>{if(o==null||!p||u)return o;const g=v=>f?.get(String(v));return d&&Array.isArray(o)?o.map(g).filter(v=>v!==void 0):g(o)??null},[o,f,d,u,p]),h=m.useCallback(g=>{const v=r||s;if(!v)return;if(g===null){v(d?[]:u||!p?null:"");return}if(u||!p){v(g);return}const w=y=>typeof y=="string"?y:y[a];v(d&&Array.isArray(g)?g.map(w):w(g))},[r,s,u,d,a,p]);return i.jsx(Qs,{..._,ref:t,options:n,value:c,onChange:h,optionValueKey:a,optionLabelKey:l,isMultiple:d})}const Rs=m.forwardRef(au);Rs.displayName="Select";const Ot={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 lt({content:e,children:t,placement:n="top",variant:o="default",size:r="md",offset:s=8,delayShow:a=100,delayHide:l=0,isDisabled:d=!1,showArrow:u=!1,maxWidth:_="320px",isInteractive:p=!1,className:f="",onOpen:c,onClose:h,isOpen:g,onOpenChange:v}){const[w,y]=m.useState(!1),x=m.useRef(null),k=g!==void 0?g:w,L=m.useCallback(O=>{d||(v?v(O):y(O),O?c?.():h?.())},[d,v,c,h]),{refs:A,floatingStyles:M,context:T,isPositioned:P}=$o({open:k,onOpenChange:L,placement:n,strategy:"fixed",middleware:[_o(s+(u?8:0)),po({fallbackAxisSideDirection:"start",padding:8}),go({padding:8}),u?td({element:x}):void 0].filter(Boolean),whileElementsMounted:co}),I=vr(T,{delay:{open:a,close:p?200:l||100},enabled:!d,move:!1,handleClose:null}),q=$d(T,{enabled:!d}),V=xo(T,{enabled:!d}),S=Eo(T,{role:"tooltip"}),{getReferenceProps:b,getFloatingProps:$}=So([I,q,V,S]),{isMounted:D,styles:N}=Mo(T,{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)"}}),C=m.useMemo(()=>[Ot.tooltip,Ot[`size_${r}`],Ot[`variant_${o}`],f].filter(Boolean).join(" "),[r,o,f]),z=m.useMemo(()=>m.cloneElement(t,b({ref:A.setReference,...t.props})),[t,b,A.setReference]);return!e||d?t:i.jsxs(i.Fragment,{children:[z,D&&i.jsx(Co,{children:i.jsx("div",{ref:A.setFloating,className:Ot.tooltip_positioner,style:{...M,maxWidth:_,zIndex:9999,pointerEvents:"none"},children:i.jsxs("div",{className:C,style:{...N,pointerEvents:p?"auto":"none",visibility:P||!k?"visible":"hidden"},...$(),children:[e,u&&i.jsx(ld,{ref:x,context:T,className:Ot.arrow})]})})})]})}/**
7
+ color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,t?.key)}return(u=t?.onChange)==null||u.call(t,a),a}return i.updateDeps=s=>{o=s},i}function rs(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const uu=(e,n)=>Math.abs(e-n)<1.01,_u=(e,n,t)=>{let o;return function(...a){e.clearTimeout(o),o=e.setTimeout(()=>n.apply(this,a),t)}},as=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},fu=e=>e,pu=e=>{const n=Math.max(e.startIndex-e.overscan,0),t=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let a=n;a<=t;a++)o.push(a);return o},gu=(e,n)=>{const t=e.scrollElement;if(!t)return;const o=e.targetWindow;if(!o)return;const a=s=>{const{width:l,height:c}=s;n({width:Math.round(l),height:Math.round(c)})};if(a(as(t)),!o.ResizeObserver)return()=>{};const i=new o.ResizeObserver(s=>{const l=()=>{const c=s[0];if(c?.borderBoxSize){const u=c.borderBoxSize[0];if(u){a({width:u.inlineSize,height:u.blockSize});return}}a(as(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},is={passive:!0},ss=typeof window>"u"?!0:"onscrollend"in window,hu=(e,n)=>{const t=e.scrollElement;if(!t)return;const o=e.targetWindow;if(!o)return;let a=0;const i=e.options.useScrollendEvent&&ss?()=>{}:_u(o,()=>{n(a,!1)},e.options.isScrollingResetDelay),s=_=>()=>{const{horizontal:g,isRtl:f}=e.options;a=g?t.scrollLeft*(f&&-1||1):t.scrollTop,i(),n(a,_)},l=s(!0),c=s(!1);c(),t.addEventListener("scroll",l,is);const u=e.options.useScrollendEvent&&ss;return u&&t.addEventListener("scrollend",c,is),()=>{t.removeEventListener("scroll",l),u&&t.removeEventListener("scrollend",c)}},mu=(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"]},vu=(e,{adjustments:n=0,behavior:t},o)=>{var a,i;const s=e+n;(i=(a=o.scrollElement)==null?void 0:a.scrollTo)==null||i.call(a,{[o.options.horizontal?"left":"top"]:s,behavior:t})};class bu{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(a=>{a.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var a;(a=o())==null||a.disconnect(),t=null},observe:a=>{var i;return(i=o())==null?void 0:i.observe(a,{box:"border-box"})},unobserve:a=>{var i;return(i=o())==null?void 0:i.unobserve(a)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([o,a])=>{typeof a>"u"&&delete t[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:fu,rangeExtractor:pu,onChange:()=>{},measureElement:mu,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,a;(a=(o=this.options).onChange)==null||a.call(o,this,t)},this.maybeNotify=kn(()=>(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(a=>{this.observer.observe(a)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,a=>{this.scrollRect=a,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(a,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<a?"forward":"backward":null,this.scrollOffset=a,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 a=new Map,i=new Map;for(let s=o-1;s>=0;s--){const l=t[s];if(a.has(l.lane))continue;const c=i.get(l.lane);if(c==null||l.end>c.end?i.set(l.lane,l):l.end<c.end&&a.set(l.lane,!0),a.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=kn(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,o,a,i,s)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:o,scrollMargin:a,getItemKey:i,enabled:s}),{key:!1}),this.getMeasurements=kn(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:o,scrollMargin:a,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(_=>{this.itemSizeCache.set(_.key,_.size)}));const c=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,c);for(let _=c;_<t;_++){const g=i(_),f=this.options.lanes===1?u[_-1]:this.getFurthestMeasurement(u,_),d=f?f.end+this.options.gap:o+a,m=l.get(g),p=typeof m=="number"?m:this.options.estimateSize(_),v=d+p,y=f?f.lane:_%this.options.lanes;u[_]={index:_,start:d,size:p,end:v,key:g,lane:y}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=kn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,o,a,i)=>this.range=t.length>0&&o>0?wu({measurements:t,outerSize:o,scrollOffset:a,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=kn(()=>{let t=null,o=null;const a=this.calculateRange();return a&&(t=a.startIndex,o=a.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,o]},(t,o,a,i,s)=>i===null||s===null?[]:t({startIndex:i,endIndex:s,overscan:o,count:a}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const o=this.options.indexAttribute,a=t.getAttribute(o);return a?parseInt(a,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(t,o)=>{const a=this.indexFromElement(t),i=this.measurementsCache[a];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(a,this.options.measureElement(t,o,this))},this.resizeItem=(t,o)=>{const a=this.measurementsCache[t];if(!a)return;const i=this.itemSizeCache.get(a.key)??a.size,s=o-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(a,s,this):a.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(a.index),this.itemSizeCache=new Map(this.itemSizeCache.set(a.key,o)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((o,a)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(a))});return}this._measureElement(t,void 0)},this.getVirtualItems=kn(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,o)=>{const a=[];for(let i=0,s=t.length;i<s;i++){const l=t[i],c=o[l];a.push(c)}return a},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const o=this.getMeasurements();if(o.length!==0)return rs(o[ls(0,o.length-1,a=>rs(o[a]).start,t)])},this.getOffsetForAlignment=(t,o,a=0)=>{const i=this.getSize(),s=this.getScrollOffset();o==="auto"&&(o=t>=s+i?"end":"start"),o==="center"?t+=(a-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 a=this.measurementsCache[t];if(!a)return;const i=this.getSize(),s=this.getScrollOffset();if(o==="auto")if(a.end>=s+i-this.options.scrollPaddingEnd)o="end";else if(a.start<=s+this.options.scrollPaddingStart)o="start";else return[s,o];const l=o==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,o,a.size),o]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:o="start",behavior:a}={})=>{a==="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:a})},this.scrollToIndex=(t,{align:o="auto",behavior:a}={})=>{a==="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 _=this.getOffsetForIndex(t,u);if(!_){console.warn("Failed to get offset for index:",t);return}const[g,f]=_;this._scrollToOffset(g,{adjustments:void 0,behavior:a}),this.targetWindow.requestAnimationFrame(()=>{const d=this.getScrollOffset(),m=this.getOffsetForIndex(t,f);if(!m){console.warn("Failed to get offset for index:",t);return}uu(m[0],d)||c(f)})},c=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 a;if(o.length===0)a=this.options.paddingStart;else if(this.options.lanes===1)a=((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--}a=Math.max(...i.filter(l=>l!==null))}return Math.max(a-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:o,behavior:a})=>{this.options.scrollToFn(t,{behavior:a,adjustments:o},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(n)}}const ls=(e,n,t,o)=>{for(;e<=n;){const a=(e+n)/2|0,i=t(a);if(i<o)e=a+1;else if(i>o)n=a-1;else return a}return e>0?e-1:0};function wu({measurements:e,outerSize:n,scrollOffset:t,lanes:o}){const a=e.length-1,i=c=>e[c].start;if(e.length<=o)return{startIndex:0,endIndex:a};let s=ls(0,a,i,t),l=s;if(o===1)for(;l<a&&e[l].end<t+n;)l++;else if(o>1){const c=Array(o).fill(0);for(;l<a&&c.some(_=>_<t+n);){const _=e[l];c[_.lane]=_.end,l++}const u=Array(o).fill(t+n);for(;s>=0&&u.some(_=>_>=t);){const _=e[s];u[_.lane]=_.start,s--}s=Math.max(0,s-s%o),l=Math.min(a,l+(o-1-l%o))}return{startIndex:s,endIndex:l}}const cs=typeof document<"u"?M.useLayoutEffect:M.useEffect;function yu(e){const n=M.useReducer(()=>({}),{})[1],t={...e,onChange:(a,i)=>{var s;i?Fn.flushSync(n):n(),(s=e.onChange)==null||s.call(e,a,i)}},[o]=M.useState(()=>new bu(t));return o.setOptions(t),cs(()=>o._didMount(),[]),cs(()=>o._willUpdate()),o}function Cu(e){return yu({observeElementRect:gu,observeElementOffset:hu,scrollToFn:vu,...e})}function xu(e,n){const[t,o]=M.useState(e);return M.useEffect(()=>{const a=setTimeout(()=>{o(e)},n);return()=>{clearTimeout(a)}},[e,n]),t}function Hr(e){const n=M.useCallback(a=>{const i=window.matchMedia(e);return i.addEventListener("change",a),()=>{i.removeEventListener("change",a)}},[e]),t=()=>window.matchMedia(e).matches,o=()=>{throw Error("useMediaQuery is a client-only hook")};return M.useSyncExternalStore(n,t,o)}function Wr(e,n){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[n]??"":e)}function Hn(e,n){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[n]??"":e)}function jo(e){return typeof e=="object"&&e!==null?!!e.disabled:!1}function ds(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}function us(e,n,t,o){if(!n.trim())return e;const a=ds(n.trim());return o?e.filter(i=>o(i,n)):e.filter(i=>ds(Wr(i,t)).includes(a))}function $u(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 Su(e){const n=[];let t=0;for(const o of e){n.push({tipo:"grupo",datos:null,nombreGrupo:o.grupo,indice:t++});for(const a of o.opciones)n.push({tipo:"opcion",datos:a,indice:t++})}return n}function ku(e,n,t,o){return n.trim()?e.map(a=>({...a,opciones:us(a.opciones,n,t,o)})).filter(a=>a.opciones.length>0):e}function Nu(e){return e.map((n,t)=>n.tipo==="grupo"||n.datos&&jo(n.datos)?t:null).filter(n=>n!==null)}function Eu(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 Mu(e,n,t){return e!==void 0?e:n==="invalid"?!0:n==="valid"?!1:!!t}function Iu(e,n="Opción"){return Array.from({length:e},(t,o)=>`${n} ${o+1}`)}function Fu(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})=>r.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:r.jsx("path",{d:"m6 9 6 6 6-6"})}),fs=({size:e="1em",...n})=>r.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:[r.jsx("path",{d:"M18 6 6 18"}),r.jsx("path",{d:"m6 6 12 12"})]}),zu=({size:e="1em",...n})=>r.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:r.jsx("path",{d:"M20 6 9 17l-5-5"})}),Lu=({size:e="1em",...n})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",...n,children:[r.jsx("path",{fill:"currentColor",d:"M10 18a7.95 7.95 0 0 0 4.897-1.688l4.396 4.396l1.414-1.414l-4.396-4.396A7.95 7.95 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8s3.589 8 8 8m0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6s-6-2.691-6-6s2.691-6 6-6"}),r.jsx("path",{fill:"currentColor",d:"M11.412 8.586c.379.38.588.882.588 1.414h2a3.98 3.98 0 0 0-1.174-2.828c-1.514-1.512-4.139-1.512-5.652 0l1.412 1.416c.76-.758 2.07-.756 2.826-.002"})]}),Au=({size:e="1em",...n})=>r.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:r.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),ue={contenedor_base:"_contenedor_base_1h7dd_1",tam_sm:"_tam_sm_1h7dd_43",tam_lg:"_tam_lg_1h7dd_57",radio_none:"_radio_none_1h7dd_71",radio_sm:"_radio_sm_1h7dd_79",radio_md:"_radio_md_1h7dd_87",radio_lg:"_radio_lg_1h7dd_95",radio_full:"_radio_full_1h7dd_103",color_default:"_color_default_1h7dd_111",color_primary:"_color_primary_1h7dd_113",color_secondary:"_color_secondary_1h7dd_121",color_success:"_color_success_1h7dd_129",color_warning:"_color_warning_1h7dd_137",color_danger:"_color_danger_1h7dd_145",etiqueta:"_etiqueta_1h7dd_153",marca_requerido:"_marca_requerido_1h7dd_169",trigger:"_trigger_1h7dd_179",trigger_expandido:"_trigger_expandido_1h7dd_215",variante_bordered:"_variante_bordered_1h7dd_225",variante_faded:"_variante_faded_1h7dd_235",variante_underlined:"_variante_underlined_1h7dd_245",variante_ghost:"_variante_ghost_1h7dd_261",deshabilitado:"_deshabilitado_1h7dd_273",solo_lectura:"_solo_lectura_1h7dd_293",valor_texto:"_valor_texto_1h7dd_309",abierto:"_abierto_1h7dd_337",valido:"_valido_1h7dd_345",invalido:"_invalido_1h7dd_353",contenido_inicio:"_contenido_inicio_1h7dd_405",contenido_final:"_contenido_final_1h7dd_407",valor_wrapper:"_valor_wrapper_1h7dd_425",mostrar_todos:"_mostrar_todos_1h7dd_445",valor_wrapper_expandido:"_valor_wrapper_expandido_1h7dd_455",placeholder:"_placeholder_1h7dd_471",chip_multi:"_chip_multi_1h7dd_481",chip_texto:"_chip_texto_1h7dd_515",chip_cerrar:"_chip_cerrar_1h7dd_527",contador_multi:"_contador_multi_1h7dd_567",acciones:"_acciones_1h7dd_581",boton_limpiar:"_boton_limpiar_1h7dd_595",tiene_valor:"_tiene_valor_1h7dd_647",icono_chevron:"_icono_chevron_1h7dd_657",icono_spinner:"_icono_spinner_1h7dd_679",girarSpinner:"_girarSpinner_1h7dd_1",menu:"_menu_1h7dd_713",buscador_wrapper:"_buscador_wrapper_1h7dd_749",buscador_interno:"_buscador_interno_1h7dd_763",icono_buscar:"_icono_buscar_1h7dd_809",input_busqueda:"_input_busqueda_1h7dd_841",lista_opciones:"_lista_opciones_1h7dd_885",lista_virtual:"_lista_virtual_1h7dd_969",contenedor_virtual:"_contenedor_virtual_1h7dd_981",encabezado_grupo:"_encabezado_grupo_1h7dd_989",opcion_virtual:"_opcion_virtual_1h7dd_1021",opcion:"_opcion_1h7dd_1021",activo:"_activo_1h7dd_1065",seleccionado:"_seleccionado_1h7dd_1081",opcion_check:"_opcion_check_1h7dd_1139",opcion_contenido:"_opcion_contenido_1h7dd_1167",sin_resultados:"_sin_resultados_1h7dd_1183",descripcion:"_descripcion_1h7dd_1207",mensaje_error:"_mensaje_error_1h7dd_1219",ancho_total:"_ancho_total_1h7dd_1231",sin_animacion:"_sin_animacion_1h7dd_1239",contenedor_nativo:"_contenedor_nativo_1h7dd_1249",select_nativo:"_select_nativo_1h7dd_1257",input_validacion:"_input_validacion_1h7dd_1285"};function Du(e){const{options:n=[],value:t,onChange:o,onValueChange:a,optionLabelKey:i="label",optionValueKey:s="id",label:l,placeholder:c="Seleccione una opción",description:u,errorMessage:_,isRequired:g=!1,isInvalid:f,id:d,name:m,classNames:p,startContent:v,endContent:y,esInvalido:w,estaDeshabilitadoReal:C,clasesBase:k,renderizarValorMostrado:z}=e,A=h.useId(),N=d??`select-nativo-${A}`,P=u?`${N}-desc`:void 0,O=w?`${N}-err`:void 0,E=h.useCallback(F=>Wr(F,i),[i]),T=h.useCallback(F=>Hn(F,s),[s]),V=h.useCallback(F=>{o?.(F),a?.(F)},[o,a]),S=h.useCallback(F=>{const I=F.target.value;if(!I){V(null);return}const $=n.find(D=>T(D)===I);$&&V($)},[n,T,V]),b=typeof f=="string"?f:null,x=typeof _=="function"?_({invalido:w,mensaje:b}):_??b;return r.jsxs("div",{className:k,children:[l&&r.jsxs("label",{className:ne(ue.etiqueta,p?.label),htmlFor:N,children:[l,g&&r.jsx("span",{className:ue.marca_requerido,children:"*"})]}),r.jsxs("div",{className:ue.contenedor_nativo,children:[r.jsxs("div",{className:ne(ue.trigger,p?.trigger),children:[v&&r.jsx("span",{className:ue.contenido_inicio,children:v}),r.jsx("div",{className:ne(ue.valor_wrapper,p?.value),children:z()}),r.jsxs("div",{className:ue.acciones,children:[y&&r.jsx("span",{className:ue.contenido_final,children:y}),r.jsx("span",{className:ue.icono_chevron,children:r.jsx(_s,{size:"1em"})})]})]}),r.jsxs("select",{id:N,name:m,className:ue.select_nativo,value:t?T(t):"",onChange:S,disabled:C,required:g,children:[r.jsx("option",{value:"",children:c}),n.map(F=>r.jsx("option",{value:T(F),disabled:jo(F),children:E(F)},T(F)))]})]}),u&&!w&&r.jsx("div",{id:P,className:ne(ue.descripcion,p?.description),children:u}),w&&x&&r.jsx("div",{id:O,className:ne(ue.mensaje_error,p?.errorMessage),children:x})]})}const Pu="(max-width: 768px)",Tu=44,Gr=320,Wn=100,Ou=200,Vu=5;function Bu(e,n){const{options:t=[],value:o,defaultValue:a,onChange:i,onValueChange:s,optionLabelKey:l="label",optionValueKey:c="id",renderOption:u,renderValue:_,variant:g="bordered",color:f="default",size:d="md",radius:m="md",fullWidth:p=!0,disableAnimation:v=!1,label:y,placeholder:w="",description:C,errorMessage:k,emptyMessage:z="No hay opciones",noResultsMessage:A="Sin resultados",isRequired:N=!1,isDisabled:P=!1,isReadOnly:O=!1,isLoading:E=!1,isClearable:T=!0,isInvalid:V,validationState:S,isMultiple:b=!1,mostrarTodos:x=!1,isSearchable:F,isVirtualized:I=!1,estimatedOptionHeight:$=Tu,filterFn:D,validate:B,onOpen:X,onClose:U,onSearchChange:L,onClear:j,onFocus:W,onBlur:ie,id:re,name:ae,className:me,classNames:ee,style:fe,startContent:R,endContent:se,menuZIndex:_e,portalContainer:Se}=e,ge=h.useRef(null),le=h.useRef([]),he=h.useRef(null),G=h.useRef(null),Y=h.useId(),ce=re??`select-${Y}`,K=Hr(Pu),q=F??(t.length>4&&!K),H=K&&!q&&!b,[de,te]=h.useState(!1),[pe,Ye]=h.useState("bottom-start"),[Oe,Ae]=h.useState(null),[Ne,ot]=h.useState(""),Me=o!==void 0,[bt,Te]=h.useState(a??null),be=Me?o:bt,Ge=P||E,lt=h.useCallback(oe=>Wr(oe,l),[l]),Ee=h.useCallback(oe=>Hn(oe,c),[c]),rt=h.useMemo(()=>{const oe=new Set;if(!be)return oe;try{if(b&&Array.isArray(be))for(const Le of be)oe.add(Hn(Le,c));else be&&oe.add(Hn(be,c))}catch{}return oe},[be,b,c]),St=h.useCallback(oe=>{try{return rt.has(Hn(oe,c))}catch{return!1}},[rt,c]),Et=h.useMemo(()=>$u(t),[t]),Ce=h.useMemo(()=>{if(!q||!Ne.trim())return t;try{return Et?ku(t,Ne,l,D):us(t,Ne,l,D)}catch{return t}},[t,Ne,q,D,l,Et]),xe=h.useMemo(()=>Et?Su(Ce):Ce.map((oe,Le)=>({tipo:"opcion",datos:oe,indice:Le})),[Ce,Et]),et=h.useMemo(()=>Eu(be,B),[be,B]),Be=h.useMemo(()=>Mu(V,S,et),[V,S,et]),wt=S==="valid"&&!Be,{refs:Tt,floatingStyles:ba,context:Ot,placement:Qo}=Do({open:de,onOpenChange:oe=>{Ge||O||(oe&&Ye("bottom-start"),te(oe),oe?(X?.(),ot(""),Ae(null)):U?.())},strategy:"fixed",transform:!1,placement:pe,middleware:[$o(4),ko({padding:8}),So({padding:8}),$i({apply({rects:oe,elements:Le,availableHeight:It}){Object.assign(Le.floating.style,{minWidth:`${oe.reference.width}px`,width:"max-content",maxWidth:`min(${Math.max(oe.reference.width,280)}px, calc(100vw - 16px))`,maxHeight:`${It}px`})},padding:8})],whileElementsMounted:yo});h.useLayoutEffect(()=>{if(!de)return;const oe=Qo.startsWith("top")?"top-start":"bottom-start";Ye(Le=>Le===oe?Le:oe)},[de,Qo]);const Ie=pe.startsWith("top"),Fe=v||xe.length>Ou?0:300,{isMounted:Je,styles:kt}=Bo(Ot,{duration:{open:Fe,close:Math.round(Fe*.5)},initial:{opacity:0,transform:Ie?"translateY(6px) scale(0.96)":"translateY(-6px) scale(0.96)"},open:{opacity:1,transform:"translateY(0) scale(1)"},close:{opacity:0,transform:Ie?"translateY(4px) scale(0.98)":"translateY(-4px) scale(0.98)"},common:{transformOrigin:Ie?"bottom center":"top center"}}),Mt=Cu({count:xe.length,getScrollElement:()=>he.current,estimateSize:()=>$,overscan:Vu,enabled:I&&de&&xe.length>Wn}),hn=Xi(Ot,{enabled:!Ge&&!O}),eo=Ao(Ot),to=Vo(Ot,{role:"listbox"}),Ro=h.useMemo(()=>{try{return Nu(xe)}catch{return[]}},[xe]),er=qr(Ot,{listRef:le,activeIndex:Oe,onNavigate:Ae,loop:!0,virtual:I,focusItemOnHover:!q,disabledIndices:Ro}),yl=h.useRef([]);h.useEffect(()=>{yl.current=xe.map(oe=>oe.tipo==="opcion"&&oe.datos?lt(oe.datos):null)},[xe,lt]);const rp=es(Ot,{listRef:yl,activeIndex:Oe,onMatch:de?Ae:void 0,enabled:!q}),{getReferenceProps:ap,getFloatingProps:ip,getItemProps:Cl}=Po([hn,eo,to,er,rp]),on=h.useCallback(oe=>{Me||Te(oe),i?.(oe),s?.(oe)},[Me,i,s]),tr=h.useCallback(oe=>{if(!jo(oe))if(b){const Le=Array.isArray(be)?be:[],It=Le.some(mt=>Ee(mt)===Ee(oe));on(It?Le.filter(mt=>Ee(mt)!==Ee(oe)):[...Le,oe])}else on(oe),te(!1)},[b,be,Ee,on]),sp=h.useCallback(oe=>{oe.stopPropagation(),on(b?[]:null),j?.(),ge.current?.focus()},[b,on,j]),xl=h.useCallback((oe,Le)=>{Le.stopPropagation(),!(!b||!Array.isArray(be))&&on(be.filter(It=>Ee(It)!==Ee(oe)))},[b,be,Ee,on]),lp=h.useCallback(oe=>{const Le=oe.target.value;ot(Le),L?.(Le),Ae(0)},[L]),cp=h.useCallback(oe=>{if(oe.key==="Enter"&&Oe!==null){oe.preventDefault();const Le=xe[Oe];Le?.tipo==="opcion"&&Le.datos&&tr(Le.datos)}},[Oe,xe,tr]);h.useEffect(()=>{de&&q&&requestAnimationFrame(()=>G.current?.focus())},[de,q]),h.useEffect(()=>{if(!de)return;const oe=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",oe>0&&(document.body.style.paddingRight=`${oe}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[de]),h.useEffect(()=>()=>{le.current=[]},[xe.length]),h.useEffect(()=>{if(!de)return;const oe=xe.findIndex(Le=>Le.tipo==="opcion"&&Le.datos!=null&&St(Le.datos));oe!==-1&&requestAnimationFrame(()=>{I&&xe.length>Wn?Mt.scrollToIndex(oe,{align:"center"}):le.current[oe]?.scrollIntoView({block:"nearest"})})},[de]),h.useImperativeHandle(n,()=>({focus:()=>ge.current?.focus(),blur:()=>ge.current?.blur(),open:()=>te(!0),close:()=>te(!1),clear:()=>on(b?[]:null)}));const nr=b?Array.isArray(be)&&be.length>0:be!=null&&be!=="",$l=h.useCallback(()=>{if(_)return _(be??null);if(!nr)return r.jsx("span",{className:ue.placeholder,children:w});if(b&&Array.isArray(be)){if(be.length===0)return r.jsx("span",{className:ue.placeholder,children:w});const oe=x?be:be.slice(0,2),Le=x?0:Math.max(0,be.length-2);return r.jsxs(r.Fragment,{children:[oe.map(It=>r.jsxs("span",{className:ue.chip_multi,children:[r.jsx("span",{className:ue.chip_texto,children:lt(It)}),!O&&!Ge&&r.jsx("button",{type:"button",className:ue.chip_cerrar,onClick:mt=>xl(It,mt),children:r.jsx(fs,{size:"1em"})})]},Ee(It))),Le>0&&r.jsxs("span",{className:ue.contador_multi,children:["+",Le]})]})}return r.jsx("span",{className:ue.valor_texto,children:lt(be)})},[_,be,nr,w,b,x,O,Ge,Ee,lt,xl]),Sl=h.useCallback((oe,Le,It)=>{try{if(oe.tipo==="grupo")return r.jsx("li",{className:ne(ue.encabezado_grupo,I&&ue.opcion_virtual),style:It,children:oe.nombreGrupo},`grupo-${oe.nombreGrupo}`);const mt=oe.datos;if(!mt)return null;const El=St(mt),Ml=Oe===Le,dp=jo(mt),up=u?u(mt,{isSelected:El,isActive:Ml}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:ue.opcion_check,children:r.jsx(zu,{size:"1em"})}),r.jsx("span",{className:ue.opcion_contenido,children:lt(mt)})]}),_p=Ee(mt);return r.jsx("li",{ref:fp=>{le.current[Le]=fp},className:ne(ue.opcion,I&&ue.opcion_virtual,{[ue.activo]:Ml,[ue.seleccionado]:El,[ue.deshabilitado]:dp},ee?.option),style:It,...Cl({onClick:()=>tr(mt)}),children:up},_p)}catch(mt){return console.error("Error rendering select item:",mt),null}},[I,Oe,St,u,lt,Ee,ee?.option,Cl,tr]),kl=typeof k=="function"?k({invalido:Be,mensaje:et}):k??et,Nl=ne(ue.contenedor_base,ue[`variante_${g}`],ue[`tam_${d}`],ue[`radio_${m}`],ue[`color_${f}`],{[ue.ancho_total]:p,[ue.sin_animacion]:v,[ue.deshabilitado]:Ge,[ue.solo_lectura]:O,[ue.invalido]:Be,[ue.valido]:wt,[ue.abierto]:de,[ue.tiene_valor]:nr},ee?.base,me);return H&&!Et?r.jsx(Du,{...e,esInvalido:Be,estaDeshabilitadoReal:Ge,clasesBase:Nl,renderizarValorMostrado:$l}):r.jsxs("div",{className:Nl,style:fe,children:[y&&r.jsxs("label",{id:`${ce}-label`,className:ne(ue.etiqueta,ee?.label),children:[y,N&&r.jsx("span",{className:ue.marca_requerido,children:"*"})]}),r.jsxs("div",{ref:oe=>{Tt.setReference(oe),ge.current=oe},id:ce,tabIndex:Ge?-1:0,className:ne(ue.trigger,x&&b&&ue.trigger_expandido,ee?.trigger),"aria-labelledby":y?`${ce}-label`:void 0,onFocus:W,onBlur:ie,...ap(),children:[R&&r.jsx("span",{className:ue.contenido_inicio,children:R}),r.jsx("div",{className:ne(ue.valor_wrapper,x&&b&&ue.mostrar_todos,x&&b&&ue.valor_wrapper_expandido,ee?.value),children:$l()}),r.jsxs("div",{className:ue.acciones,children:[T&&nr&&!O&&!Ge&&r.jsx("button",{type:"button",className:ne(ue.boton_limpiar,ee?.clearButton),onClick:sp,tabIndex:-1,children:r.jsx(fs,{size:"1em"})}),se&&r.jsx("span",{className:ue.contenido_final,children:se}),E?r.jsx("span",{className:ue.icono_spinner,children:r.jsx(Au,{size:"1em"})}):r.jsx("span",{className:ue.icono_chevron,children:r.jsx(_s,{size:"1em"})})]})]}),(ae||N)&&r.jsx("input",{type:"text",name:ae,required:N,value:b&&Array.isArray(be)?be.map(Ee).join(","):be?Ee(be):"",onChange:()=>{},onFocus:oe=>oe.target.blur(),"aria-hidden":"true",className:ue.input_validacion}),Je&&r.jsx(Lo,{root:Se,children:r.jsx(Or,{context:Ot,modal:!1,initialFocus:q?G:-1,children:r.jsxs("div",{ref:Tt.setFloating,style:{...ba,...kt,zIndex:_e??"var(--z-popover)",transitionTimingFunction:Ot.open?"cubic-bezier(0.32, 0.72, 0, 1)":"cubic-bezier(0.4, 0, 1, 1)"},className:ne(ue.menu,ee?.menu),...ip(),children:[q&&r.jsx("div",{className:ue.buscador_wrapper,children:r.jsxs("div",{className:ue.buscador_interno,children:[r.jsx("span",{className:ue.icono_buscar,children:r.jsx(Lu,{size:"1.6em"})}),r.jsx("input",{ref:G,type:"text",className:ne(ue.input_busqueda,ee?.searchInput),placeholder:"Buscar...",value:Ne,onChange:lp,onKeyDown:cp})]})}),r.jsx("ul",{ref:he,className:ne(ue.lista_opciones,I&&ue.lista_virtual),style:{height:I&&xe.length>Wn?`${Gr}px`:`${Math.min(xe.length*$,Gr)}px`,maxHeight:`${Gr}px`,overflow:"auto",position:I&&xe.length>Wn?"relative":void 0},children:xe.length===0?r.jsx("li",{className:ue.sin_resultados,children:Ne?A:z}):I&&xe.length>Wn?r.jsx(r.Fragment,{children:r.jsx("div",{style:{height:`${Mt.getTotalSize()}px`,position:"relative",width:"100%"},children:Mt.getVirtualItems().map(oe=>{const Le=xe[oe.index];return Le?r.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,width:"100%",height:`${oe.size}px`,transform:`translateY(${oe.start}px)`},children:Sl(Le,oe.index)},`virtual-${oe.index}`):null})})}):xe.map((oe,Le)=>Sl(oe,Le))})]})})}),C&&!Be&&r.jsx("div",{className:ne(ue.descripcion,ee?.description),children:C}),Be&&kl&&r.jsx("div",{className:ne(ue.mensaje_error,ee?.errorMessage),children:kl})]})}const ju=h.forwardRef(Bu),ps=h.memo(ju);ps.displayName="SelectBase";function qu(e,n){const{options:t=[],value:o,onChange:a,onValueChange:i,optionValueKey:s,optionLabelKey:l="label",isMultiple:c=!1,devolverObjeto:u=!1,..._}=e,g=h.useMemo(()=>t.length>0&&typeof t[0]=="object",[t]),f=h.useMemo(()=>{if(!g||!s)return null;const p=new Map;for(const v of t)p.set(String(v[s]),v);return p},[t,s,g]),d=h.useMemo(()=>{if(o==null||!g||u)return o;const p=v=>f?.get(String(v));return c&&Array.isArray(o)?o.map(p).filter(v=>v!==void 0):p(o)??null},[o,f,c,u,g]),m=h.useCallback(p=>{const v=a||i;if(!v)return;if(p===null){v(c?[]:u||!g?null:"");return}if(u||!g){v(p);return}const y=w=>typeof w=="string"?w:w[s];v(c&&Array.isArray(p)?p.map(y):y(p))},[a,i,u,c,s,g]);return r.jsx(ps,{..._,ref:n,options:t,value:d,onChange:m,optionValueKey:s,optionLabelKey:l,isMultiple:c})}const gs=h.forwardRef(qu);gs.displayName="Select";const Gn={tooltip:"_tooltip_aqvwg_1",tooltip_positioner:"_tooltip_positioner_aqvwg_53",enterAnimation:"_enterAnimation_aqvwg_1",exitAnimation:"_exitAnimation_aqvwg_1",arrow:"_arrow_aqvwg_81",size_sm:"_size_sm_aqvwg_91",size_md:"_size_md_aqvwg_101",size_lg:"_size_lg_aqvwg_111",variant_default:"_variant_default_aqvwg_121",variant_dark:"_variant_dark_aqvwg_141",variant_light:"_variant_light_aqvwg_153",variant_brand:"_variant_brand_aqvwg_165",variant_success:"_variant_success_aqvwg_181",variant_warning:"_variant_warning_aqvwg_193",variant_danger:"_variant_danger_aqvwg_205",variant_info:"_variant_info_aqvwg_217",fadeOnly:"_fadeOnly_aqvwg_1"};function _n({content:e,children:n,placement:t="top",variant:o="default",size:a="md",offset:i=8,delayShow:s=100,delayHide:l=0,isDisabled:c=!1,showArrow:u=!1,maxWidth:_="320px",isInteractive:g=!1,className:f="",onOpen:d,onClose:m,isOpen:p,onOpenChange:v}){const[y,w]=h.useState(!1),C=h.useRef(null),k=p!==void 0?p:y,z=h.useCallback(B=>{c||(v?v(B):w(B),B?d?.():m?.())},[c,v,d,m]),{refs:A,floatingStyles:N,context:P,isPositioned:O}=Do({open:k,onOpenChange:z,placement:t,strategy:"fixed",middleware:[$o(i+(u?8:0)),ko({fallbackAxisSideDirection:"start",padding:8}),So({padding:8}),u?Td({element:C}):void 0].filter(Boolean),whileElementsMounted:yo}),E=Ar(P,{delay:{open:s,close:g?200:l||100},enabled:!c,move:!1,handleClose:null}),T=au(P,{enabled:!c}),V=Ao(P,{enabled:!c}),S=Vo(P,{role:"tooltip"}),{getReferenceProps:b,getFloatingProps:x}=Po([E,T,V,S]),{isMounted:F,styles:I}=Bo(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)"}}),$=h.useMemo(()=>[Gn.tooltip,Gn[`size_${a}`],Gn[`variant_${o}`],f].filter(Boolean).join(" "),[a,o,f]),D=h.useMemo(()=>h.cloneElement(n,b({ref:A.setReference,...n.props})),[n,b,A.setReference]);return!e||c?n:r.jsxs(r.Fragment,{children:[D,F&&r.jsx(Lo,{children:r.jsx("div",{ref:A.setFloating,className:Gn.tooltip_positioner,style:{...N,maxWidth:_,zIndex:9999,pointerEvents:"none"},children:r.jsxs("div",{className:$,style:{...I,pointerEvents:g?"auto":"none",visibility:O||!k?"visible":"hidden"},...x(),children:[e,u&&r.jsx(Hd,{ref:C,context:P,className:Gn.arrow})]})})})]})}/**
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 Yn(e,t){return typeof e=="function"?e(t):e}function Cn(e,t){return n=>{t.setState(o=>({...o,[e]:Yn(n,o[e])}))}}function Ao(e){return e instanceof Function}function lu(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function cu(e,t){const n=[],o=r=>{r.forEach(s=>{n.push(s);const a=t(s);a!=null&&a.length&&o(a)})};return o(e),n}function ce(e,t,n){let o=[],r;return s=>{let a;n.key&&n.debug&&(a=Date.now());const l=e(s);if(!(l.length!==o.length||l.some((_,p)=>o[p]!==_)))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 _=Math.round((Date.now()-a)*100)/100,p=Math.round((Date.now()-u)*100)/100,f=p/16,c=(h,g)=>{for(h=String(h);h.length<g;)h=" "+h;return h};console.info(`%c⏱ ${c(p,5)} /${c(_,5)} ms`,`
16
+ */function Rt(e,n){return typeof e=="function"?e(n):e}function $t(e,n){return t=>{n.setState(o=>({...o,[e]:Rt(t,o[e])}))}}function qo(e){return e instanceof Function}function Hu(e){return Array.isArray(e)&&e.every(n=>typeof n=="number")}function Wu(e,n){const t=[],o=a=>{a.forEach(i=>{t.push(i);const s=n(i);s!=null&&s.length&&o(s)})};return o(e),t}function we(e,n,t){let o=[],a;return i=>{let s;t.key&&t.debug&&(s=Date.now());const l=e(i);if(!(l.length!==o.length||l.some((_,g)=>o[g]!==_)))return a;o=l;let u;if(t.key&&t.debug&&(u=Date.now()),a=n(...l),t==null||t.onChange==null||t.onChange(a),t.key&&t.debug&&t!=null&&t.debug()){const _=Math.round((Date.now()-s)*100)/100,g=Math.round((Date.now()-u)*100)/100,f=g/16,d=(m,p)=>{for(m=String(m);m.length<p;)m=" "+m;return m};console.info(`%c⏱ ${d(g,5)} /${d(_,5)} ms`,`
17
17
  font-size: .6rem;
18
18
  font-weight: bold;
19
- color: hsl(${Math.max(0,Math.min(120-120*f,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 du(e,t,n,o){const r=()=>{var a;return(a=s.getValue())!=null?a:e.options.renderFallbackValue},s={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:r,getContext:ce(()=>[e,n,t,s],(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(s,n,t,e)},{}),s}function uu(e,t,n,o){var r,s;const l={...e._getDefaultColumnDef(),...t},d=l.accessorKey;let u=(r=(s=l.id)!=null?s:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?r:typeof l.header=="string"?l.header:void 0,_;if(l.accessorFn?_=l.accessorFn:d&&(d.includes(".")?_=f=>{let c=f;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=>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:_,parent:o,depth:n,columnDef:l,columns:[],getFlatColumns:ce(()=>[!0],()=>{var f;return[p,...(f=p.columns)==null?void 0:f.flatMap(c=>c.getFlatColumns())]},de(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:ce(()=>[e._getOrderColumnsFn()],f=>{var c;if((c=p.columns)!=null&&c.length){let h=p.columns.flatMap(g=>g.getLeafColumns());return f(h)}return[p]},de(e.options,"debugColumns","column.getLeafColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(p,e);return p}const _n="debugHeaders";function ea(e,t,n){var o;let s={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(s),a},getContext:()=>({table:e,header:s,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(s,e)}),s}const fu={createTable:e=>{e.getHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>{var s,a;const l=(s=o?.map(p=>n.find(f=>f.id===p)).filter(Boolean))!=null?s:[],d=(a=r?.map(p=>n.find(f=>f.id===p)).filter(Boolean))!=null?a:[],u=n.filter(p=>!(o!=null&&o.includes(p.id))&&!(r!=null&&r.includes(p.id)));return Lo(t,[...l,...u,...d],e)},de(e.options,_n,"getHeaderGroups")),e.getCenterHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>(n=n.filter(s=>!(o!=null&&o.includes(s.id))&&!(r!=null&&r.includes(s.id))),Lo(t,n,e,"center")),de(e.options,_n,"getCenterHeaderGroups")),e.getLeftHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,o)=>{var r;const s=(r=o?.map(a=>n.find(l=>l.id===a)).filter(Boolean))!=null?r:[];return Lo(t,s,e,"left")},de(e.options,_n,"getLeftHeaderGroups")),e.getRightHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,o)=>{var r;const s=(r=o?.map(a=>n.find(l=>l.id===a)).filter(Boolean))!=null?r:[];return Lo(t,s,e,"right")},de(e.options,_n,"getRightHeaderGroups")),e.getFooterGroups=ce(()=>[e.getHeaderGroups()],t=>[...t].reverse(),de(e.options,_n,"getFooterGroups")),e.getLeftFooterGroups=ce(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),de(e.options,_n,"getLeftFooterGroups")),e.getCenterFooterGroups=ce(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),de(e.options,_n,"getCenterFooterGroups")),e.getRightFooterGroups=ce(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),de(e.options,_n,"getRightFooterGroups")),e.getFlatHeaders=ce(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,_n,"getFlatHeaders")),e.getLeftFlatHeaders=ce(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,_n,"getLeftFlatHeaders")),e.getCenterFlatHeaders=ce(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,_n,"getCenterFlatHeaders")),e.getRightFlatHeaders=ce(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,_n,"getRightFlatHeaders")),e.getCenterLeafHeaders=ce(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),de(e.options,_n,"getCenterLeafHeaders")),e.getLeftLeafHeaders=ce(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),de(e.options,_n,"getLeftLeafHeaders")),e.getRightLeafHeaders=ce(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),de(e.options,_n,"getRightLeafHeaders")),e.getLeafHeaders=ce(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,o)=>{var r,s,a,l,d,u;return[...(r=(s=t[0])==null?void 0:s.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(_=>_.getLeafHeaders()).flat()},de(e.options,_n,"getLeafHeaders"))}};function Lo(e,t,n,o){var r,s;let a=0;const l=function(f,c){c===void 0&&(c=1),a=Math.max(a,c),f.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=(f,c)=>{const h={depth:c,id:[o,`${c}`].filter(Boolean).join("_"),headers:[]},g=[];f.forEach(v=>{const w=[...g].reverse()[0],y=v.column.depth===h.depth;let x,k=!1;if(y&&v.column.parent?x=v.column.parent:(x=v.column,k=!0),w&&w?.column===x)w.subHeaders.push(v);else{const L=ea(n,x,{id:[o,c,x.id,v?.id].filter(Boolean).join("_"),isPlaceholder:k,placeholderId:k?`${g.filter(A=>A.column===x).length}`:void 0,depth:c,index:g.length});L.subHeaders.push(v),g.push(L)}h.headers.push(v),v.headerGroup=h}),d.push(h),c>0&&u(g,c-1)},_=t.map((f,c)=>ea(n,f,{depth:a,index:c}));u(_,a-1),d.reverse();const p=f=>f.filter(h=>h.column.getIsVisible()).map(h=>{let g=0,v=0,w=[0];h.subHeaders&&h.subHeaders.length?(w=[],p(h.subHeaders).forEach(x=>{let{colSpan:k,rowSpan:L}=x;g+=k,w.push(L)})):g=1;const y=Math.min(...w);return v=v+y,h.colSpan=g,h.rowSpan=v,{colSpan:g,rowSpan:v}});return p((r=(s=d[0])==null?void 0:s.headers)!=null?r:[]),d}const Nr=(e,t,n,o,r,s,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:()=>cu(l.subRows,d=>d.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let d=[],u=l;for(;;){const _=u.getParentRow();if(!_)break;d.push(_),u=_}return d.reverse()},getAllCells:ce(()=>[e.getAllLeafColumns()],d=>d.map(u=>du(e,l,u,u.id)),de(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:ce(()=>[l.getAllCells()],d=>d.reduce((u,_)=>(u[_.column.id]=_,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},_u={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()}}},na=(e,t,n)=>{var o,r;const s=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(s))};na.autoRemove=e=>En(e);const ta=(e,t,n)=>{var o;return!!(!((o=e.getValue(t))==null||(o=o.toString())==null)&&o.includes(n))};ta.autoRemove=e=>En(e);const oa=(e,t,n)=>{var o;return((o=e.getValue(t))==null||(o=o.toString())==null?void 0:o.toLowerCase())===n?.toLowerCase()};oa.autoRemove=e=>En(e);const ra=(e,t,n)=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(n)};ra.autoRemove=e=>En(e);const ia=(e,t,n)=>!n.some(o=>{var r;return!((r=e.getValue(t))!=null&&r.includes(o))});ia.autoRemove=e=>En(e)||!(e!=null&&e.length);const sa=(e,t,n)=>n.some(o=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(o)});sa.autoRemove=e=>En(e)||!(e!=null&&e.length);const aa=(e,t,n)=>e.getValue(t)===n;aa.autoRemove=e=>En(e);const la=(e,t,n)=>e.getValue(t)==n;la.autoRemove=e=>En(e);const Fr=(e,t,n)=>{let[o,r]=n;const s=e.getValue(t);return s>=o&&s<=r};Fr.resolveFilterValue=e=>{let[t,n]=e,o=typeof t!="number"?parseFloat(t):t,r=typeof n!="number"?parseFloat(n):n,s=t===null||Number.isNaN(o)?-1/0:o,a=n===null||Number.isNaN(r)?1/0:r;if(s>a){const l=s;s=a,a=l}return[s,a]},Fr.autoRemove=e=>En(e)||En(e[0])&&En(e[1]);const qn={includesString:na,includesStringSensitive:ta,equalsString:oa,arrIncludes:ra,arrIncludesAll:ia,arrIncludesSome:sa,equals:aa,weakEquals:la,inNumberRange:Fr};function En(e){return e==null||e===""}const gu={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Cn("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"?qn.includesString:typeof o=="number"?qn.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?qn.equals:Array.isArray(o)?qn.arrIncludes:qn.weakEquals},e.getFilterFn=()=>{var n,o;return Ao(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:qn[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(),s=o?.find(_=>_.id===e.id),a=Yn(n,s?s.value:void 0);if(ca(r,a,e)){var l;return(l=o?.filter(_=>_.id!==e.id))!=null?l:[]}const d={id:e.id,value:a};if(s){var u;return(u=o?.map(_=>_.id===e.id?d:_))!=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 s;return(s=Yn(t,r))==null?void 0:s.filter(a=>{const l=n.find(d=>d.id===a.id);if(l){const d=l.getFilterFn();if(ca(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 ca(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Ar={sum:(e,t,n)=>n.reduce((o,r)=>{const s=r.getValue(e);return o+(typeof s=="number"?s:0)},0),min:(e,t,n)=>{let o;return n.forEach(r=>{const s=r.getValue(e);s!=null&&(o>s||o===void 0&&s>=s)&&(o=s)}),o},max:(e,t,n)=>{let o;return n.forEach(r=>{const s=r.getValue(e);s!=null&&(o<s||o===void 0&&s>=s)&&(o=s)}),o},extent:(e,t,n)=>{let o,r;return n.forEach(s=>{const a=s.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 s=r.getValue(e);s!=null&&(s=+s)>=s&&(++n,o+=s)}),n)return o/n},median:(e,t)=>{if(!t.length)return;const n=t.map(s=>s.getValue(e));if(!lu(n))return;if(n.length===1)return n[0];const o=Math.floor(n.length/2),r=n.sort((s,a)=>s-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},pu={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:Cn("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 Ar.sum;if(Object.prototype.toString.call(o)==="[object Date]")return Ar.extent},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return Ao(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:Ar[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 hu(e,t,n){if(!(t!=null&&t.length)||!n)return e;const o=e.filter(s=>!t.includes(s.id));return n==="remove"?o:[...t.map(s=>e.find(a=>a.id===s)).filter(Boolean),...o]}const mu={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Cn("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ce(n=>[Vt(t,n)],n=>n.findIndex(o=>o.id===e.id),de(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var o;return((o=Vt(t,n)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=n=>{var o;const r=Vt(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 s=[];if(!(t!=null&&t.length))s=r;else{const a=[...t],l=[...r];for(;l.length&&a.length;){const d=a.shift(),u=l.findIndex(_=>_.id===d);u>-1&&s.push(l.splice(u,1)[0])}s=[...s,...l]}return hu(s,n,o)},de(e.options,"debugTable","_getOrderColumnsFn"))}},Lr=()=>({left:[],right:[]}),vu={getInitialState:e=>({columnPinning:Lr(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Cn("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const o=e.getLeafColumns().map(r=>r.id).filter(Boolean);t.setColumnPinning(r=>{var s,a;if(n==="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(n==="left"){var u,_;return{left:[...((u=r?.left)!=null?u:[]).filter(p=>!(o!=null&&o.includes(p))),...o],right:((_=r?.right)!=null?_:[]).filter(p=>!(o!=null&&o.includes(p)))}}return{left:((s=r?.left)!=null?s:[]).filter(p=>!(o!=null&&o.includes(p))),right:((a=r?.right)!=null?a:[]).filter(p=>!(o!=null&&o.includes(p)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var r,s,a;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((s=(a=t.options.enableColumnPinning)!=null?a:t.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(l=>l.id),{left:o,right:r}=t.getState().columnPinning,s=n.some(l=>o?.includes(l)),a=n.some(l=>r?.includes(l));return s?"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 s=[...o??[],...r??[]];return n.filter(a=>!s.includes(a.column.id))},de(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=ce(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,o)=>(o??[]).map(s=>n.find(a=>a.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),de(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=ce(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,o)=>(o??[]).map(s=>n.find(a=>a.column.id===s)).filter(Boolean).map(s=>({...s,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?Lr():(n=(o=e.initialState)==null?void 0:o.columnPinning)!=null?n:Lr())},e.getIsSomeColumnsPinned=t=>{var n;const o=e.getState().columnPinning;if(!t){var r,s;return!!((r=o.left)!=null&&r.length||(s=o.right)!=null&&s.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(s=>!r.includes(s.id))},de(e.options,"debugColumns","getCenterLeafColumns"))}};function bu(e){return e||(typeof document<"u"?document:null)}const Do={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Dr=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),wu={getDefaultColumnDef:()=>Do,getInitialState:e=>({columnSizing:{},columnSizingInfo:Dr(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Cn("columnSizing",e),onColumnSizingInfoChange:Cn("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,o,r;const s=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Do.minSize,(o=s??e.columnDef.size)!=null?o:Do.size),(r=e.columnDef.maxSize)!=null?r:Do.maxSize)},e.getStart=ce(n=>[n,Vt(t,n),t.getState().columnSizing],(n,o)=>o.slice(0,e.getIndex(n)).reduce((r,s)=>r+s.getSize(),0),de(t.options,"debugColumns","getStart")),e.getAfter=ce(n=>[n,Vt(t,n),t.getState().columnSizing],(n,o)=>o.slice(e.getIndex(n)+1).reduce((r,s)=>r+s.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 s;n+=(s=r.column.getSize())!=null?s: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 s=>{if(!o||!r||(s.persist==null||s.persist(),zr(s)&&s.touches&&s.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=zr(s)?Math.round(s.touches[0].clientX):s.clientX,u={},_=(w,y)=>{typeof y=="number"&&(t.setColumnSizingInfo(x=>{var k,L;const A=t.options.columnResizeDirection==="rtl"?-1:1,M=(y-((k=x?.startOffset)!=null?k:0))*A,T=Math.max(M/((L=x?.startSize)!=null?L:0),-.999999);return x.columnSizingStart.forEach(P=>{let[I,q]=P;u[I]=Math.round(Math.max(q+q*T,0)*100)/100}),{...x,deltaOffset:M,deltaPercentage:T}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(x=>({...x,...u})))},p=w=>_("move",w),f=w=>{_("end",w),t.setColumnSizingInfo(y=>({...y,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},c=bu(n),h={moveHandler:w=>p(w.clientX),upHandler:w=>{c?.removeEventListener("mousemove",h.moveHandler),c?.removeEventListener("mouseup",h.upHandler),f(w.clientX)}},g={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),p(w.touches[0].clientX),!1),upHandler:w=>{var y;c?.removeEventListener("touchmove",g.moveHandler),c?.removeEventListener("touchend",g.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),f((y=w.touches[0])==null?void 0:y.clientX)}},v=yu()?{passive:!1}:!1;zr(s)?(c?.addEventListener("touchmove",g.moveHandler,v),c?.addEventListener("touchend",g.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?Dr():(n=e.initialState.columnSizingInfo)!=null?n:Dr())},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 zo=null;function yu(){if(typeof zo=="boolean")return zo;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 zo=e,zo}function zr(e){return e.type==="touchstart"}const Cu={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Cn("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(s=>s.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(s=>s.getIsVisible==null?void 0:s.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,s)=>({...r,[s.id]:n||!(s.getCanHide!=null&&s.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 Vt(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const xu={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()}}},$u={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Cn("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,s;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((o=t.options.enableGlobalFilter)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&((s=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>qn.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:o}=e.options;return Ao(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[o])!=null?t:qn[o]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Su={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Cn("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,s;e.setExpanded(o?{}:(r=(s=e.initialState)==null?void 0:s.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(s=>{const a=s.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 s=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:!s,!s&&n)return{...a,[e.id]:!0};if(s&&!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()}}}},Pr=0,Tr=10,Or=()=>({pageIndex:Pr,pageSize:Tr}),ku={getInitialState:e=>({...e,pagination:{...Or(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Cn("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=s=>Yn(o,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=o=>{var r;e.setPagination(o?Or():(r=e.initialState.pagination)!=null?r:Or())},e.setPageIndex=o=>{e.setPagination(r=>{let s=Yn(o,r.pageIndex);const a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,a)),{...r,pageIndex:s}})},e.resetPageIndex=o=>{var r,s;e.setPageIndex(o?Pr:(r=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?r:Pr)},e.resetPageSize=o=>{var r,s;e.setPageSize(o?Tr:(r=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?r:Tr)},e.setPageSize=o=>{e.setPagination(r=>{const s=Math.max(1,Yn(o,r.pageSize)),a=r.pageSize*r.pageIndex,l=Math.floor(a/s);return{...r,pageIndex:l,pageSize:s}})},e.setPageCount=o=>e.setPagination(r=>{var s;let a=Yn(o,(s=e.options.pageCount)!=null?s:-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((s,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}}},Vr=()=>({top:[],bottom:[]}),Iu={getInitialState:e=>({rowPinning:Vr(),...e}),getDefaultOptions:e=>({onRowPinningChange:Cn("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,o,r)=>{const s=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,...s]);t.setRowPinning(d=>{var u,_;if(n==="bottom"){var p,f;return{top:((p=d?.top)!=null?p:[]).filter(g=>!(l!=null&&l.has(g))),bottom:[...((f=d?.bottom)!=null?f:[]).filter(g=>!(l!=null&&l.has(g))),...Array.from(l)]}}if(n==="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:((_=d?.bottom)!=null?_:[]).filter(g=>!(l!=null&&l.has(g)))}})},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,s=n.some(l=>o?.includes(l)),a=n.some(l=>r?.includes(l));return s?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var n,o;const r=e.getIsPinned();if(!r)return-1;const s=(n=r==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(a=>{let{id:l}=a;return l});return(o=s?.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?Vr():(n=(o=e.initialState)==null?void 0:o.rowPinning)!=null?n:Vr())},e.getIsSomeRowsPinned=t=>{var n;const o=e.getState().rowPinning;if(!t){var r,s;return!!((r=o.top)!=null&&r.length||(s=o.bottom)!=null&&s.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(s=>!r.has(s.id))},de(e.options,"debugRows","getCenterRows"))}},Eu={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Cn("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(s=>{s.getCanSelect()&&(o[s.id]=!0)}):r.forEach(s=>{delete o[s.id]}),o})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const o=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),r={...n};return e.getRowModel().rows.forEach(s=>{qr(r,s.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ce(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?jr(e,n):{rows:[],flatRows:[],rowsById:{}},de(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=ce(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?jr(e,n):{rows:[],flatRows:[],rowsById:{}},de(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=ce(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?jr(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(s=>{var a;if(n=typeof n<"u"?n:!r,e.getCanSelect()&&r===n)return s;const l={...s};return qr(l,e.id,n,(a=o?.selectChildren)!=null?a:!0,t),l})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Br(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Hr(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Hr(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)}}}},qr=(e,t,n,o,r)=>{var s;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&&(s=a.subRows)!=null&&s.length&&a.getCanSelectSubRows()&&a.subRows.forEach(l=>qr(e,l.id,n,o,r))};function jr(e,t){const n=e.getState().rowSelection,o=[],r={},s=function(a,l){return a.map(d=>{var u;const _=Br(d,n);if(_&&(o.push(d),r[d.id]=d),(u=d.subRows)!=null&&u.length&&(d={...d,subRows:s(d.subRows)}),_)return d}).filter(Boolean)};return{rows:s(t.rows),flatRows:o,rowsById:r}}function Br(e,t){var n;return(n=t[e.id])!=null?n:!1}function Hr(e,t,n){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let r=!0,s=!1;return e.subRows.forEach(a=>{if(!(s&&!r)&&(a.getCanSelect()&&(Br(a,t)?s=!0:r=!1),a.subRows&&a.subRows.length)){const l=Hr(a,t);l==="all"?s=!0:(l==="some"&&(s=!0),r=!1)}}),r?"all":s?"some":!1}const Gr=/([0-9]+)/gm,Mu=(e,t,n)=>da(Zn(e.getValue(n)).toLowerCase(),Zn(t.getValue(n)).toLowerCase()),Nu=(e,t,n)=>da(Zn(e.getValue(n)),Zn(t.getValue(n))),Fu=(e,t,n)=>Wr(Zn(e.getValue(n)).toLowerCase(),Zn(t.getValue(n)).toLowerCase()),Au=(e,t,n)=>Wr(Zn(e.getValue(n)),Zn(t.getValue(n))),Lu=(e,t,n)=>{const o=e.getValue(n),r=t.getValue(n);return o>r?1:o<r?-1:0},Du=(e,t,n)=>Wr(e.getValue(n),t.getValue(n));function Wr(e,t){return e===t?0:e>t?1:-1}function Zn(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function da(e,t){const n=e.split(Gr).filter(Boolean),o=t.split(Gr).filter(Boolean);for(;n.length&&o.length;){const r=n.shift(),s=o.shift(),a=parseInt(r,10),l=parseInt(s,10),d=[a,l].sort();if(isNaN(d[0])){if(r>s)return 1;if(s>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 qt={alphanumeric:Mu,alphanumericCaseSensitive:Nu,text:Fu,textCaseSensitive:Au,datetime:Lu,basic:Du},zu=[fu,Cu,mu,vu,_u,gu,xu,$u,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Cn("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 s=r?.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return qt.datetime;if(typeof s=="string"&&(o=!0,s.split(Gr).length>1))return qt.alphanumeric}return o?qt.text:qt.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 Ao(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:qt[e.columnDef.sortingFn]},e.toggleSorting=(n,o)=>{const r=e.getNextSortingOrder(),s=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=[],_,p=s?n:r==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&o?l?_="toggle":_="add":a!=null&&a.length&&d!==a.length-1?_="replace":l?_="toggle":_="replace",_==="toggle"&&(s||r||(_="remove")),_==="add"){var f;u=[...a,{id:e.id,desc:p}],u.splice(0,u.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else _==="toggle"?u=a.map(c=>c.id===e.id?{...c,desc:p}:c):_==="remove"?u=a.filter(c=>c.id!==e.id):u=[{id:e.id,desc:p}];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 s=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==s&&((o=t.options.enableSortingRemoval)==null||o)&&(!(n&&(r=t.options.enableMultiRemove)!=null)||r)?!1:a==="desc"?"asc":"desc":s},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())}},pu,Su,ku,Iu,Eu,wu];function Pu(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const o=[...zu,...(t=e._features)!=null?t:[]];let r={_features:o};const s=r._features.reduce((f,c)=>Object.assign(f,c.getDefaultOptions==null?void 0:c.getDefaultOptions(r)),{}),a=f=>r.options.mergeOptions?r.options.mergeOptions(s,f):{...s,...f};let d={...{},...(n=e.initialState)!=null?n:{}};r._features.forEach(f=>{var c;d=(c=f.getInitialState==null?void 0:f.getInitialState(d))!=null?c:d});const u=[];let _=!1;const p={_features:o,options:{...s,...e},initialState:d,_queue:f=>{u.push(f),_||(_=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();_=!1}).catch(c=>setTimeout(()=>{throw c})))},reset:()=>{r.setState(r.initialState)},setOptions:f=>{const c=Yn(f,r.options);r.options=a(c)},getState:()=>r.options.state,setState:f=>{r.options.onStateChange==null||r.options.onStateChange(f)},_getRowId:(f,c,h)=>{var g;return(g=r.options.getRowId==null?void 0:r.options.getRowId(f,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:(f,c)=>{let h=(c?r.getPrePaginationRowModel():r.getRowModel()).rowsById[f];if(!h&&(h=r.getCoreRowModel().rowsById[f],!h))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${f}`):new Error;return h},_getDefaultColumnDef:ce(()=>[r.options.defaultColumn],f=>{var c;return f=(c=f)!=null?c:{},{header:h=>{const g=h.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:h=>{var g,v;return(g=(v=h.renderValue())==null||v.toString==null?void 0:v.toString())!=null?g:null},...r._features.reduce((h,g)=>Object.assign(h,g.getDefaultColumnDef==null?void 0:g.getDefaultColumnDef()),{}),...f}},de(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:ce(()=>[r._getColumnDefs()],f=>{const c=function(h,g,v){return v===void 0&&(v=0),h.map(w=>{const y=uu(r,w,v,g),x=w;return y.columns=x.columns?c(x.columns,y,v+1):[],y})};return c(f)},de(e,"debugColumns","getAllColumns")),getAllFlatColumns:ce(()=>[r.getAllColumns()],f=>f.flatMap(c=>c.getFlatColumns()),de(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:ce(()=>[r.getAllFlatColumns()],f=>f.reduce((c,h)=>(c[h.id]=h,c),{}),de(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:ce(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(f,c)=>{let h=f.flatMap(g=>g.getLeafColumns());return c(h)},de(e,"debugColumns","getAllLeafColumns")),getColumn:f=>{const c=r._getAllFlatColumnsById()[f];return process.env.NODE_ENV!=="production"&&!c&&console.error(`[Table] Column with id '${f}' does not exist.`),c}};Object.assign(r,p);for(let f=0;f<r._features.length;f++){const c=r._features[f];c==null||c.createTable==null||c.createTable(r)}return r}function Tu(){return e=>ce(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(r,s,a){s===void 0&&(s=0);const l=[];for(let u=0;u<r.length;u++){const _=Nr(e,e._getRowId(r[u],u,a),r[u],u,s,void 0,a?.id);if(n.flatRows.push(_),n.rowsById[_.id]=_,l.push(_),e.options.getSubRows){var d;_.originalSubRows=e.options.getSubRows(r[u],u),(d=_.originalSubRows)!=null&&d.length&&(_.subRows=o(_.originalSubRows,s+1,_))}}return l};return n.rows=o(t),n},de(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Ou(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 Vu(e,t,n){return n.options.filterFromLeafRows?qu(e,t,n):ju(e,t,n)}function qu(e,t,n){var o;const r=[],s={},a=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,l=function(d,u){u===void 0&&(u=0);const _=[];for(let f=0;f<d.length;f++){var p;let c=d[f];const h=Nr(n,c.id,c.original,c.index,c.depth,void 0,c.parentId);if(h.columnFilters=c.columnFilters,(p=c.subRows)!=null&&p.length&&u<a){if(h.subRows=l(c.subRows,u+1),c=h,t(c)&&!h.subRows.length){_.push(c),s[c.id]=c,r.push(c);continue}if(t(c)||h.subRows.length){_.push(c),s[c.id]=c,r.push(c);continue}}else c=h,t(c)&&(_.push(c),s[c.id]=c,r.push(c))}return _};return{rows:l(e),flatRows:r,rowsById:s}}function ju(e,t,n){var o;const r=[],s={},a=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,l=function(d,u){u===void 0&&(u=0);const _=[];for(let f=0;f<d.length;f++){let c=d[f];if(t(c)){var p;if((p=c.subRows)!=null&&p.length&&u<a){const g=Nr(n,c.id,c.original,c.index,c.depth,void 0,c.parentId);g.subRows=l(c.subRows,u+1),c=g}_.push(c),r.push(c),s[c.id]=c}}return _};return{rows:l(e),flatRows:r,rowsById:s}}function Bu(){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 f=0;f<t.flatRows.length;f++)t.flatRows[f].columnFilters={},t.flatRows[f].columnFiltersMeta={};return t}const r=[],s=[];(n??[]).forEach(f=>{var c;const h=e.getColumn(f.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:f.id,filterFn:g,resolvedValue:(c=g.resolveFilterValue==null?void 0:g.resolveFilterValue(f.value))!=null?c:f.value})});const a=(n??[]).map(f=>f.id),l=e.getGlobalFilterFn(),d=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());o&&l&&d.length&&(a.push("__global__"),d.forEach(f=>{var c;s.push({id:f.id,filterFn:l,resolvedValue:(c=l.resolveFilterValue==null?void 0:l.resolveFilterValue(o))!=null?c:o})}));let u,_;for(let f=0;f<t.flatRows.length;f++){const c=t.flatRows[f];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,v=>{c.columnFiltersMeta[g]=v})}if(s.length){for(let h=0;h<s.length;h++){_=s[h];const g=_.id;if(_.filterFn(c,g,_.resolvedValue,v=>{c.columnFiltersMeta[g]=v})){c.columnFilters.__global__=!0;break}}c.columnFilters.__global__!==!0&&(c.columnFilters.__global__=!1)}}const p=f=>{for(let c=0;c<a.length;c++)if(f.columnFilters[a[c]]===!1)return!1;return!0};return Vu(t.rows,p,e)},de(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Hu(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:s}=n;let{rows:a,flatRows:l,rowsById:d}=o;const u=r*s,_=u+r;a=a.slice(u,_);let p;t.options.paginateExpandedRows?p={rows:a,flatRows:l,rowsById:d}:p=Ou({rows:a,flatRows:l,rowsById:d}),p.flatRows=[];const f=c=>{p.flatRows.push(c),c.subRows.length&&c.subRows.forEach(f)};return p.rows.forEach(f),p},de(t.options,"debugTable","getPaginationRowModel"))}function Gu(){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=[],s=o.filter(d=>{var u;return(u=e.getColumn(d.id))==null?void 0:u.getCanSort()}),a={};s.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(_=>({..._}));return u.sort((_,p)=>{for(let c=0;c<s.length;c+=1){var f;const h=s[c],g=a[h.id],v=g.sortUndefined,w=(f=h?.desc)!=null?f:!1;let y=0;if(v){const x=_.getValue(h.id),k=p.getValue(h.id),L=x===void 0,A=k===void 0;if(L||A){if(v==="first")return L?-1:1;if(v==="last")return L?1:-1;y=L&&A?0:L?v:-v}}if(y===0&&(y=g.sortingFn(_,p,h.id)),y!==0)return w&&(y*=-1),g.invertSorting&&(y*=-1),y}return _.index-p.index}),u.forEach(_=>{var p;r.push(_),(p=_.subRows)!=null&&p.length&&(_.subRows=l(_.subRows))}),u};return{rows:l(n.rows),flatRows:r,rowsById:n.rowsById}},de(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
19
+ color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,t?.key)}return a}}function ye(e,n,t,o){return{debug:()=>{var a;return(a=e?.debugAll)!=null?a:e[n]},key:process.env.NODE_ENV==="development"&&t,onChange:o}}function Gu(e,n,t,o){const a=()=>{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:a,getContext:we(()=>[e,t,n,i],(s,l,c,u)=>({table:s,column:l,row:c,cell:u,getValue:u.getValue,renderValue:u.renderValue}),ye(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,t,n,e)},{}),i}function Zu(e,n,t,o){var a,i;const l={...e._getDefaultColumnDef(),...n},c=l.accessorKey;let u=(a=(i=l.id)!=null?i:c?typeof String.prototype.replaceAll=="function"?c.replaceAll(".","_"):c.replace(/\./g,"_"):void 0)!=null?a:typeof l.header=="string"?l.header:void 0,_;if(l.accessorFn?_=l.accessorFn:c&&(c.includes(".")?_=f=>{let d=f;for(const p of c.split(".")){var m;d=(m=d)==null?void 0:m[p],process.env.NODE_ENV!=="production"&&d===void 0&&console.warn(`"${p}" in deeply nested key "${c}" returned undefined.`)}return d}:_=f=>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:_,parent:o,depth:t,columnDef:l,columns:[],getFlatColumns:we(()=>[!0],()=>{var f;return[g,...(f=g.columns)==null?void 0:f.flatMap(d=>d.getFlatColumns())]},ye(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:we(()=>[e._getOrderColumnsFn()],f=>{var d;if((d=g.columns)!=null&&d.length){let m=g.columns.flatMap(p=>p.getLeafColumns());return f(m)}return[g]},ye(e.options,"debugColumns","column.getLeafColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(g,e);return g}const pt="debugHeaders";function hs(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=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(l),s.push(c)};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 Uu={createTable:e=>{e.getHeaderGroups=we(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o,a)=>{var i,s;const l=(i=o?.map(g=>t.find(f=>f.id===g)).filter(Boolean))!=null?i:[],c=(s=a?.map(g=>t.find(f=>f.id===g)).filter(Boolean))!=null?s:[],u=t.filter(g=>!(o!=null&&o.includes(g.id))&&!(a!=null&&a.includes(g.id)));return Ho(n,[...l,...u,...c],e)},ye(e.options,pt,"getHeaderGroups")),e.getCenterHeaderGroups=we(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o,a)=>(t=t.filter(i=>!(o!=null&&o.includes(i.id))&&!(a!=null&&a.includes(i.id))),Ho(n,t,e,"center")),ye(e.options,pt,"getCenterHeaderGroups")),e.getLeftHeaderGroups=we(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(n,t,o)=>{var a;const i=(a=o?.map(s=>t.find(l=>l.id===s)).filter(Boolean))!=null?a:[];return Ho(n,i,e,"left")},ye(e.options,pt,"getLeftHeaderGroups")),e.getRightHeaderGroups=we(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(n,t,o)=>{var a;const i=(a=o?.map(s=>t.find(l=>l.id===s)).filter(Boolean))!=null?a:[];return Ho(n,i,e,"right")},ye(e.options,pt,"getRightHeaderGroups")),e.getFooterGroups=we(()=>[e.getHeaderGroups()],n=>[...n].reverse(),ye(e.options,pt,"getFooterGroups")),e.getLeftFooterGroups=we(()=>[e.getLeftHeaderGroups()],n=>[...n].reverse(),ye(e.options,pt,"getLeftFooterGroups")),e.getCenterFooterGroups=we(()=>[e.getCenterHeaderGroups()],n=>[...n].reverse(),ye(e.options,pt,"getCenterFooterGroups")),e.getRightFooterGroups=we(()=>[e.getRightHeaderGroups()],n=>[...n].reverse(),ye(e.options,pt,"getRightFooterGroups")),e.getFlatHeaders=we(()=>[e.getHeaderGroups()],n=>n.map(t=>t.headers).flat(),ye(e.options,pt,"getFlatHeaders")),e.getLeftFlatHeaders=we(()=>[e.getLeftHeaderGroups()],n=>n.map(t=>t.headers).flat(),ye(e.options,pt,"getLeftFlatHeaders")),e.getCenterFlatHeaders=we(()=>[e.getCenterHeaderGroups()],n=>n.map(t=>t.headers).flat(),ye(e.options,pt,"getCenterFlatHeaders")),e.getRightFlatHeaders=we(()=>[e.getRightHeaderGroups()],n=>n.map(t=>t.headers).flat(),ye(e.options,pt,"getRightFlatHeaders")),e.getCenterLeafHeaders=we(()=>[e.getCenterFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),ye(e.options,pt,"getCenterLeafHeaders")),e.getLeftLeafHeaders=we(()=>[e.getLeftFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),ye(e.options,pt,"getLeftLeafHeaders")),e.getRightLeafHeaders=we(()=>[e.getRightFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),ye(e.options,pt,"getRightLeafHeaders")),e.getLeafHeaders=we(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(n,t,o)=>{var a,i,s,l,c,u;return[...(a=(i=n[0])==null?void 0:i.headers)!=null?a:[],...(s=(l=t[0])==null?void 0:l.headers)!=null?s:[],...(c=(u=o[0])==null?void 0:u.headers)!=null?c:[]].map(_=>_.getLeafHeaders()).flat()},ye(e.options,pt,"getLeafHeaders"))}};function Ho(e,n,t,o){var a,i;let s=0;const l=function(f,d){d===void 0&&(d=1),s=Math.max(s,d),f.filter(m=>m.getIsVisible()).forEach(m=>{var p;(p=m.columns)!=null&&p.length&&l(m.columns,d+1)},0)};l(e);let c=[];const u=(f,d)=>{const m={depth:d,id:[o,`${d}`].filter(Boolean).join("_"),headers:[]},p=[];f.forEach(v=>{const y=[...p].reverse()[0],w=v.column.depth===m.depth;let C,k=!1;if(w&&v.column.parent?C=v.column.parent:(C=v.column,k=!0),y&&y?.column===C)y.subHeaders.push(v);else{const z=hs(t,C,{id:[o,d,C.id,v?.id].filter(Boolean).join("_"),isPlaceholder:k,placeholderId:k?`${p.filter(A=>A.column===C).length}`:void 0,depth:d,index:p.length});z.subHeaders.push(v),p.push(z)}m.headers.push(v),v.headerGroup=m}),c.push(m),d>0&&u(p,d-1)},_=n.map((f,d)=>hs(t,f,{depth:s,index:d}));u(_,s-1),c.reverse();const g=f=>f.filter(m=>m.column.getIsVisible()).map(m=>{let p=0,v=0,y=[0];m.subHeaders&&m.subHeaders.length?(y=[],g(m.subHeaders).forEach(C=>{let{colSpan:k,rowSpan:z}=C;p+=k,y.push(z)})):p=1;const w=Math.min(...y);return v=v+w,m.colSpan=p,m.rowSpan=v,{colSpan:p,rowSpan:v}});return g((a=(i=c[0])==null?void 0:i.headers)!=null?a:[]),c}const Zr=(e,n,t,o,a,i,s)=>{let l={id:n,index:o,original:t,depth:a,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(l._valuesCache.hasOwnProperty(c))return l._valuesCache[c];const u=e.getColumn(c);if(u!=null&&u.accessorFn)return l._valuesCache[c]=u.accessorFn(l.original,o),l._valuesCache[c]},getUniqueValues:c=>{if(l._uniqueValuesCache.hasOwnProperty(c))return l._uniqueValuesCache[c];const u=e.getColumn(c);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(l._uniqueValuesCache[c]=u.columnDef.getUniqueValues(l.original,o),l._uniqueValuesCache[c]):(l._uniqueValuesCache[c]=[l.getValue(c)],l._uniqueValuesCache[c])},renderValue:c=>{var u;return(u=l.getValue(c))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Wu(l.subRows,c=>c.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let c=[],u=l;for(;;){const _=u.getParentRow();if(!_)break;c.push(_),u=_}return c.reverse()},getAllCells:we(()=>[e.getAllLeafColumns()],c=>c.map(u=>Gu(e,l,u,u.id)),ye(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:we(()=>[l.getAllCells()],c=>c.reduce((u,_)=>(u[_.column.id]=_,u),{}),ye(e.options,"debugRows","getAllCellsByColumnId"))};for(let c=0;c<e._features.length;c++){const u=e._features[c];u==null||u.createRow==null||u.createRow(l,e)}return l},Ku={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()}}},ms=(e,n,t)=>{var o,a;const i=t==null||(o=t.toString())==null?void 0:o.toLowerCase();return!!(!((a=e.getValue(n))==null||(a=a.toString())==null||(a=a.toLowerCase())==null)&&a.includes(i))};ms.autoRemove=e=>zt(e);const vs=(e,n,t)=>{var o;return!!(!((o=e.getValue(n))==null||(o=o.toString())==null)&&o.includes(t))};vs.autoRemove=e=>zt(e);const bs=(e,n,t)=>{var o;return((o=e.getValue(n))==null||(o=o.toString())==null?void 0:o.toLowerCase())===t?.toLowerCase()};bs.autoRemove=e=>zt(e);const ws=(e,n,t)=>{var o;return(o=e.getValue(n))==null?void 0:o.includes(t)};ws.autoRemove=e=>zt(e);const ys=(e,n,t)=>!t.some(o=>{var a;return!((a=e.getValue(n))!=null&&a.includes(o))});ys.autoRemove=e=>zt(e)||!(e!=null&&e.length);const Cs=(e,n,t)=>t.some(o=>{var a;return(a=e.getValue(n))==null?void 0:a.includes(o)});Cs.autoRemove=e=>zt(e)||!(e!=null&&e.length);const xs=(e,n,t)=>e.getValue(n)===t;xs.autoRemove=e=>zt(e);const $s=(e,n,t)=>e.getValue(n)==t;$s.autoRemove=e=>zt(e);const Ur=(e,n,t)=>{let[o,a]=t;const i=e.getValue(n);return i>=o&&i<=a};Ur.resolveFilterValue=e=>{let[n,t]=e,o=typeof n!="number"?parseFloat(n):n,a=typeof t!="number"?parseFloat(t):t,i=n===null||Number.isNaN(o)?-1/0:o,s=t===null||Number.isNaN(a)?1/0:a;if(i>s){const l=i;i=s,s=l}return[i,s]},Ur.autoRemove=e=>zt(e)||zt(e[0])&&zt(e[1]);const Wt={includesString:ms,includesStringSensitive:vs,equalsString:bs,arrIncludes:ws,arrIncludesAll:ys,arrIncludesSome:Cs,equals:xs,weakEquals:$s,inNumberRange:Ur};function zt(e){return e==null||e===""}const Xu={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:$t("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"?Wt.includesString:typeof o=="number"?Wt.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Wt.equals:Array.isArray(o)?Wt.arrIncludes:Wt.weakEquals},e.getFilterFn=()=>{var t,o;return qo(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:Wt[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,o,a;return((t=e.columnDef.enableColumnFilter)!=null?t:!0)&&((o=n.options.enableColumnFilters)!=null?o:!0)&&((a=n.options.enableFilters)!=null?a:!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(a=>a.id===e.id))!=null?t:-1},e.setFilterValue=t=>{n.setColumnFilters(o=>{const a=e.getFilterFn(),i=o?.find(_=>_.id===e.id),s=Rt(t,i?i.value:void 0);if(Ss(a,s,e)){var l;return(l=o?.filter(_=>_.id!==e.id))!=null?l:[]}const c={id:e.id,value:s};if(i){var u;return(u=o?.map(_=>_.id===e.id?c:_))!=null?u:[]}return o!=null&&o.length?[...o,c]:[c]})}},createRow:(e,n)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=n=>{const t=e.getAllLeafColumns(),o=a=>{var i;return(i=Rt(n,a))==null?void 0:i.filter(s=>{const l=t.find(c=>c.id===s.id);if(l){const c=l.getFilterFn();if(Ss(c,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 Ss(e,n,t){return(e&&e.autoRemove?e.autoRemove(n,t):!1)||typeof n>"u"||typeof n=="string"&&!n}const Kr={sum:(e,n,t)=>t.reduce((o,a)=>{const i=a.getValue(e);return o+(typeof i=="number"?i:0)},0),min:(e,n,t)=>{let o;return t.forEach(a=>{const i=a.getValue(e);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},max:(e,n,t)=>{let o;return t.forEach(a=>{const i=a.getValue(e);i!=null&&(o<i||o===void 0&&i>=i)&&(o=i)}),o},extent:(e,n,t)=>{let o,a;return t.forEach(i=>{const s=i.getValue(e);s!=null&&(o===void 0?s>=s&&(o=a=s):(o>s&&(o=s),a<s&&(a=s)))}),[o,a]},mean:(e,n)=>{let t=0,o=0;if(n.forEach(a=>{let i=a.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(!Hu(t))return;if(t.length===1)return t[0];const o=Math.floor(t.length/2),a=t.sort((i,s)=>i-s);return t.length%2!==0?a[o]:(a[o-1]+a[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},Yu={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:$t("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 Kr.sum;if(Object.prototype.toString.call(o)==="[object Date]")return Kr.extent},e.getAggregationFn=()=>{var t,o;if(!e)throw new Error;return qo(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:Kr[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 a;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((a=t.subRows)!=null&&a.length)}}};function Ju(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 Qu={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:$t("columnOrder",e)}),createColumn:(e,n)=>{e.getIndex=we(t=>[Zn(n,t)],t=>t.findIndex(o=>o.id===e.id),ye(n.options,"debugColumns","getIndex")),e.getIsFirstColumn=t=>{var o;return((o=Zn(n,t)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=t=>{var o;const a=Zn(n,t);return((o=a[a.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=we(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(n,t,o)=>a=>{let i=[];if(!(n!=null&&n.length))i=a;else{const s=[...n],l=[...a];for(;l.length&&s.length;){const c=s.shift(),u=l.findIndex(_=>_.id===c);u>-1&&i.push(l.splice(u,1)[0])}i=[...i,...l]}return Ju(i,t,o)},ye(e.options,"debugTable","_getOrderColumnsFn"))}},Xr=()=>({left:[],right:[]}),Ru={getInitialState:e=>({columnPinning:Xr(),...e}),getDefaultOptions:e=>({onColumnPinningChange:$t("columnPinning",e)}),createColumn:(e,n)=>{e.pin=t=>{const o=e.getLeafColumns().map(a=>a.id).filter(Boolean);n.setColumnPinning(a=>{var i,s;if(t==="right"){var l,c;return{left:((l=a?.left)!=null?l:[]).filter(g=>!(o!=null&&o.includes(g))),right:[...((c=a?.right)!=null?c:[]).filter(g=>!(o!=null&&o.includes(g))),...o]}}if(t==="left"){var u,_;return{left:[...((u=a?.left)!=null?u:[]).filter(g=>!(o!=null&&o.includes(g))),...o],right:((_=a?.right)!=null?_:[]).filter(g=>!(o!=null&&o.includes(g)))}}return{left:((i=a?.left)!=null?i:[]).filter(g=>!(o!=null&&o.includes(g))),right:((s=a?.right)!=null?s:[]).filter(g=>!(o!=null&&o.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var a,i,s;return((a=o.columnDef.enablePinning)!=null?a:!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:a}=n.getState().columnPinning,i=t.some(l=>o?.includes(l)),s=t.some(l=>a?.includes(l));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var t,o;const a=e.getIsPinned();return a?(t=(o=n.getState().columnPinning)==null||(o=o[a])==null?void 0:o.indexOf(e.id))!=null?t:-1:0}},createRow:(e,n)=>{e.getCenterVisibleCells=we(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left,n.getState().columnPinning.right],(t,o,a)=>{const i=[...o??[],...a??[]];return t.filter(s=>!i.includes(s.column.id))},ye(n.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=we(()=>[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"})),ye(n.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=we(()=>[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"})),ye(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?Xr():(t=(o=e.initialState)==null?void 0:o.columnPinning)!=null?t:Xr())},e.getIsSomeColumnsPinned=n=>{var t;const o=e.getState().columnPinning;if(!n){var a,i;return!!((a=o.left)!=null&&a.length||(i=o.right)!=null&&i.length)}return!!((t=o[n])!=null&&t.length)},e.getLeftLeafColumns=we(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(n,t)=>(t??[]).map(o=>n.find(a=>a.id===o)).filter(Boolean),ye(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=we(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(n,t)=>(t??[]).map(o=>n.find(a=>a.id===o)).filter(Boolean),ye(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=we(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o)=>{const a=[...t??[],...o??[]];return n.filter(i=>!a.includes(i.id))},ye(e.options,"debugColumns","getCenterLeafColumns"))}};function e_(e){return e||(typeof document<"u"?document:null)}const Wo={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Yr=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),t_={getDefaultColumnDef:()=>Wo,getInitialState:e=>({columnSizing:{},columnSizingInfo:Yr(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:$t("columnSizing",e),onColumnSizingInfoChange:$t("columnSizingInfo",e)}),createColumn:(e,n)=>{e.getSize=()=>{var t,o,a;const i=n.getState().columnSizing[e.id];return Math.min(Math.max((t=e.columnDef.minSize)!=null?t:Wo.minSize,(o=i??e.columnDef.size)!=null?o:Wo.size),(a=e.columnDef.maxSize)!=null?a:Wo.maxSize)},e.getStart=we(t=>[t,Zn(n,t),n.getState().columnSizing],(t,o)=>o.slice(0,e.getIndex(t)).reduce((a,i)=>a+i.getSize(),0),ye(n.options,"debugColumns","getStart")),e.getAfter=we(t=>[t,Zn(n,t),n.getState().columnSizing],(t,o)=>o.slice(e.getIndex(t)+1).reduce((a,i)=>a+i.getSize(),0),ye(n.options,"debugColumns","getAfter")),e.resetSize=()=>{n.setColumnSizing(t=>{let{[e.id]:o,...a}=t;return a})},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=a=>{if(a.subHeaders.length)a.subHeaders.forEach(o);else{var i;t+=(i=a.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),a=o?.getCanResize();return i=>{if(!o||!a||(i.persist==null||i.persist(),Jr(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),l=e?e.getLeafHeaders().map(y=>[y.column.id,y.column.getSize()]):[[o.id,o.getSize()]],c=Jr(i)?Math.round(i.touches[0].clientX):i.clientX,u={},_=(y,w)=>{typeof w=="number"&&(n.setColumnSizingInfo(C=>{var k,z;const A=n.options.columnResizeDirection==="rtl"?-1:1,N=(w-((k=C?.startOffset)!=null?k:0))*A,P=Math.max(N/((z=C?.startSize)!=null?z:0),-.999999);return C.columnSizingStart.forEach(O=>{let[E,T]=O;u[E]=Math.round(Math.max(T+T*P,0)*100)/100}),{...C,deltaOffset:N,deltaPercentage:P}}),(n.options.columnResizeMode==="onChange"||y==="end")&&n.setColumnSizing(C=>({...C,...u})))},g=y=>_("move",y),f=y=>{_("end",y),n.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},d=e_(t),m={moveHandler:y=>g(y.clientX),upHandler:y=>{d?.removeEventListener("mousemove",m.moveHandler),d?.removeEventListener("mouseup",m.upHandler),f(y.clientX)}},p={moveHandler:y=>(y.cancelable&&(y.preventDefault(),y.stopPropagation()),g(y.touches[0].clientX),!1),upHandler:y=>{var w;d?.removeEventListener("touchmove",p.moveHandler),d?.removeEventListener("touchend",p.upHandler),y.cancelable&&(y.preventDefault(),y.stopPropagation()),f((w=y.touches[0])==null?void 0:w.clientX)}},v=n_()?{passive:!1}:!1;Jr(i)?(d?.addEventListener("touchmove",p.moveHandler,v),d?.addEventListener("touchend",p.upHandler,v)):(d?.addEventListener("mousemove",m.moveHandler,v),d?.addEventListener("mouseup",m.upHandler,v)),n.setColumnSizingInfo(y=>({...y,startOffset:c,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?Yr():(t=e.initialState.columnSizingInfo)!=null?t:Yr())},e.getTotalSize=()=>{var n,t;return(n=(t=e.getHeaderGroups()[0])==null?void 0:t.headers.reduce((o,a)=>o+a.getSize(),0))!=null?n:0},e.getLeftTotalSize=()=>{var n,t;return(n=(t=e.getLeftHeaderGroups()[0])==null?void 0:t.headers.reduce((o,a)=>o+a.getSize(),0))!=null?n:0},e.getCenterTotalSize=()=>{var n,t;return(n=(t=e.getCenterHeaderGroups()[0])==null?void 0:t.headers.reduce((o,a)=>o+a.getSize(),0))!=null?n:0},e.getRightTotalSize=()=>{var n,t;return(n=(t=e.getRightHeaderGroups()[0])==null?void 0:t.headers.reduce((o,a)=>o+a.getSize(),0))!=null?n:0}}};let Go=null;function n_(){if(typeof Go=="boolean")return Go;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 Go=e,Go}function Jr(e){return e.type==="touchstart"}const o_={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:$t("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 a=e.columns;return(t=a.length?a.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=we(()=>[e.getAllCells(),n.getState().columnVisibility],t=>t.filter(o=>o.column.getIsVisible()),ye(n.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=we(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(t,o,a)=>[...t,...o,...a],ye(n.options,"debugRows","getVisibleCells"))},createTable:e=>{const n=(t,o)=>we(()=>[o(),o().filter(a=>a.getIsVisible()).map(a=>a.id).join("_")],a=>a.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ye(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((a,i)=>({...a,[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 Zn(e,n){return n?n==="center"?e.getCenterVisibleLeafColumns():n==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const r_={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()}}},a_={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:$t("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,a,i;return((t=e.columnDef.enableGlobalFilter)!=null?t:!0)&&((o=n.options.enableGlobalFilter)!=null?o:!0)&&((a=n.options.enableFilters)!=null?a:!0)&&((i=n.options.getColumnCanGlobalFilter==null?void 0:n.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Wt.includesString,e.getGlobalFilterFn=()=>{var n,t;const{globalFilterFn:o}=e.options;return qo(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(n=(t=e.options.filterFns)==null?void 0:t[o])!=null?n:Wt[o]},e.setGlobalFilter=n=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(n)},e.resetGlobalFilter=n=>{e.setGlobalFilter(n?void 0:e.initialState.globalFilter)}}},i_={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:$t("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let n=!1,t=!1;e._autoResetExpanded=()=>{var o,a;if(!n){e._queue(()=>{n=!0});return}if((o=(a=e.options.autoResetAll)!=null?a: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 a,i;e.setExpanded(o?{}:(a=(i=e.initialState)==null?void 0:i.expanded)!=null?a:{})},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(a=>!a.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 a;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=(a=t)!=null?a:!i,!i&&t)return{...s,[e.id]:!0};if(i&&!t){const{[e.id]:l,...c}=s;return c}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,a;return(t=n.options.getRowCanExpand==null?void 0:n.options.getRowCanExpand(e))!=null?t:((o=n.options.enableExpanding)!=null?o:!0)&&!!((a=e.subRows)!=null&&a.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()}}}},Qr=0,Rr=10,ea=()=>({pageIndex:Qr,pageSize:Rr}),s_={getInitialState:e=>({...e,pagination:{...ea(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:$t("pagination",e)}),createTable:e=>{let n=!1,t=!1;e._autoResetPageIndex=()=>{var o,a;if(!n){e._queue(()=>{n=!0});return}if((o=(a=e.options.autoResetAll)!=null?a:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(t)return;t=!0,e._queue(()=>{e.resetPageIndex(),t=!1})}},e.setPagination=o=>{const a=i=>Rt(o,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(a)},e.resetPagination=o=>{var a;e.setPagination(o?ea():(a=e.initialState.pagination)!=null?a:ea())},e.setPageIndex=o=>{e.setPagination(a=>{let i=Rt(o,a.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)),{...a,pageIndex:i}})},e.resetPageIndex=o=>{var a,i;e.setPageIndex(o?Qr:(a=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?a:Qr)},e.resetPageSize=o=>{var a,i;e.setPageSize(o?Rr:(a=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?a:Rr)},e.setPageSize=o=>{e.setPagination(a=>{const i=Math.max(1,Rt(o,a.pageSize)),s=a.pageSize*a.pageIndex,l=Math.floor(s/i);return{...a,pageIndex:l,pageSize:i}})},e.setPageCount=o=>e.setPagination(a=>{var i;let s=Rt(o,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...a,pageCount:s}}),e.getPageOptions=we(()=>[e.getPageCount()],o=>{let a=[];return o&&o>0&&(a=[...new Array(o)].fill(null).map((i,s)=>s)),a},ye(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:o}=e.getState().pagination,a=e.getPageCount();return a===-1?!0:a===0?!1:o<a-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}}},ta=()=>({top:[],bottom:[]}),l_={getInitialState:e=>({rowPinning:ta(),...e}),getDefaultOptions:e=>({onRowPinningChange:$t("rowPinning",e)}),createRow:(e,n)=>{e.pin=(t,o,a)=>{const i=o?e.getLeafRows().map(c=>{let{id:u}=c;return u}):[],s=a?e.getParentRows().map(c=>{let{id:u}=c;return u}):[],l=new Set([...s,e.id,...i]);n.setRowPinning(c=>{var u,_;if(t==="bottom"){var g,f;return{top:((g=c?.top)!=null?g:[]).filter(p=>!(l!=null&&l.has(p))),bottom:[...((f=c?.bottom)!=null?f:[]).filter(p=>!(l!=null&&l.has(p))),...Array.from(l)]}}if(t==="top"){var d,m;return{top:[...((d=c?.top)!=null?d:[]).filter(p=>!(l!=null&&l.has(p))),...Array.from(l)],bottom:((m=c?.bottom)!=null?m:[]).filter(p=>!(l!=null&&l.has(p)))}}return{top:((u=c?.top)!=null?u:[]).filter(p=>!(l!=null&&l.has(p))),bottom:((_=c?.bottom)!=null?_:[]).filter(p=>!(l!=null&&l.has(p)))}})},e.getCanPin=()=>{var t;const{enableRowPinning:o,enablePinning:a}=n.options;return typeof o=="function"?o(e):(t=o??a)!=null?t:!0},e.getIsPinned=()=>{const t=[e.id],{top:o,bottom:a}=n.getState().rowPinning,i=t.some(l=>o?.includes(l)),s=t.some(l=>a?.includes(l));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var t,o;const a=e.getIsPinned();if(!a)return-1;const i=(t=a==="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?ta():(t=(o=e.initialState)==null?void 0:o.rowPinning)!=null?t:ta())},e.getIsSomeRowsPinned=n=>{var t;const o=e.getState().rowPinning;if(!n){var a,i;return!!((a=o.top)!=null&&a.length||(i=o.bottom)!=null&&i.length)}return!!((t=o[n])!=null&&t.length)},e._getPinnedRows=(n,t,o)=>{var a;return((a=e.options.keepPinnedRows)==null||a?(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=we(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(n,t)=>e._getPinnedRows(n,t,"top"),ye(e.options,"debugRows","getTopRows")),e.getBottomRows=we(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(n,t)=>e._getPinnedRows(n,t,"bottom"),ye(e.options,"debugRows","getBottomRows")),e.getCenterRows=we(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(n,t,o)=>{const a=new Set([...t??[],...o??[]]);return n.filter(i=>!a.has(i.id))},ye(e.options,"debugRows","getCenterRows"))}},c_={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:$t("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},a=e.getPreGroupedRowModel().flatRows;return n?a.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):a.forEach(i=>{delete o[i.id]}),o})},e.toggleAllPageRowsSelected=n=>e.setRowSelection(t=>{const o=typeof n<"u"?n:!e.getIsAllPageRowsSelected(),a={...t};return e.getRowModel().rows.forEach(i=>{na(a,i.id,o,!0,e)}),a}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=we(()=>[e.getState().rowSelection,e.getCoreRowModel()],(n,t)=>Object.keys(n).length?oa(e,t):{rows:[],flatRows:[],rowsById:{}},ye(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=we(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(n,t)=>Object.keys(n).length?oa(e,t):{rows:[],flatRows:[],rowsById:{}},ye(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=we(()=>[e.getState().rowSelection,e.getSortedRowModel()],(n,t)=>Object.keys(n).length?oa(e,t):{rows:[],flatRows:[],rowsById:{}},ye(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(a=>a.getCanSelect()&&!t[a.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows.filter(a=>a.getCanSelect()),{rowSelection:t}=e.getState();let o=!!n.length;return o&&n.some(a=>!t[a.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 a=e.getIsSelected();n.setRowSelection(i=>{var s;if(t=typeof t<"u"?t:!a,e.getCanSelect()&&a===t)return i;const l={...i};return na(l,e.id,t,(s=o?.selectChildren)!=null?s:!0,n),l})},e.getIsSelected=()=>{const{rowSelection:t}=n.getState();return ra(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=n.getState();return aa(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=n.getState();return aa(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 a;t&&e.toggleSelected((a=o.target)==null?void 0:a.checked)}}}},na=(e,n,t,o,a)=>{var i;const s=a.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=>na(e,l.id,t,o,a))};function oa(e,n){const t=e.getState().rowSelection,o=[],a={},i=function(s,l){return s.map(c=>{var u;const _=ra(c,t);if(_&&(o.push(c),a[c.id]=c),(u=c.subRows)!=null&&u.length&&(c={...c,subRows:i(c.subRows)}),_)return c}).filter(Boolean)};return{rows:i(n.rows),flatRows:o,rowsById:a}}function ra(e,n){var t;return(t=n[e.id])!=null?t:!1}function aa(e,n,t){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let a=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!a)&&(s.getCanSelect()&&(ra(s,n)?i=!0:a=!1),s.subRows&&s.subRows.length)){const l=aa(s,n);l==="all"?i=!0:(l==="some"&&(i=!0),a=!1)}}),a?"all":i?"some":!1}const ia=/([0-9]+)/gm,d_=(e,n,t)=>ks(en(e.getValue(t)).toLowerCase(),en(n.getValue(t)).toLowerCase()),u_=(e,n,t)=>ks(en(e.getValue(t)),en(n.getValue(t))),__=(e,n,t)=>sa(en(e.getValue(t)).toLowerCase(),en(n.getValue(t)).toLowerCase()),f_=(e,n,t)=>sa(en(e.getValue(t)),en(n.getValue(t))),p_=(e,n,t)=>{const o=e.getValue(t),a=n.getValue(t);return o>a?1:o<a?-1:0},g_=(e,n,t)=>sa(e.getValue(t),n.getValue(t));function sa(e,n){return e===n?0:e>n?1:-1}function en(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function ks(e,n){const t=e.split(ia).filter(Boolean),o=n.split(ia).filter(Boolean);for(;t.length&&o.length;){const a=t.shift(),i=o.shift(),s=parseInt(a,10),l=parseInt(i,10),c=[s,l].sort();if(isNaN(c[0])){if(a>i)return 1;if(i>a)return-1;continue}if(isNaN(c[1]))return isNaN(s)?-1:1;if(s>l)return 1;if(l>s)return-1}return t.length-o.length}const Un={alphanumeric:d_,alphanumericCaseSensitive:u_,text:__,textCaseSensitive:f_,datetime:p_,basic:g_},h_=[Uu,o_,Qu,Ru,Ku,Xu,r_,a_,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:$t("sorting",e),isMultiSortEvent:n=>n.shiftKey}),createColumn:(e,n)=>{e.getAutoSortingFn=()=>{const t=n.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const a of t){const i=a?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Un.datetime;if(typeof i=="string"&&(o=!0,i.split(ia).length>1))return Un.alphanumeric}return o?Un.text:Un.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 qo(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:Un[e.columnDef.sortingFn]},e.toggleSorting=(t,o)=>{const a=e.getNextSortingOrder(),i=typeof t<"u"&&t!==null;n.setSorting(s=>{const l=s?.find(d=>d.id===e.id),c=s?.findIndex(d=>d.id===e.id);let u=[],_,g=i?t:a==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&o?l?_="toggle":_="add":s!=null&&s.length&&c!==s.length-1?_="replace":l?_="toggle":_="replace",_==="toggle"&&(i||a||(_="remove")),_==="add"){var f;u=[...s,{id:e.id,desc:g}],u.splice(0,u.length-((f=n.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else _==="toggle"?u=s.map(d=>d.id===e.id?{...d,desc:g}:d):_==="remove"?u=s.filter(d=>d.id!==e.id):u=[{id:e.id,desc:g}];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,a;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((o=n.options.enableSortingRemoval)==null||o)&&(!(t&&(a=n.options.enableMultiRemove)!=null)||a)?!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(a=>a.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(a=>a.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())}},Yu,i_,s_,l_,c_,t_];function m_(e){var n,t;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const o=[...h_,...(n=e._features)!=null?n:[]];let a={_features:o};const i=a._features.reduce((f,d)=>Object.assign(f,d.getDefaultOptions==null?void 0:d.getDefaultOptions(a)),{}),s=f=>a.options.mergeOptions?a.options.mergeOptions(i,f):{...i,...f};let c={...{},...(t=e.initialState)!=null?t:{}};a._features.forEach(f=>{var d;c=(d=f.getInitialState==null?void 0:f.getInitialState(c))!=null?d:c});const u=[];let _=!1;const g={_features:o,options:{...i,...e},initialState:c,_queue:f=>{u.push(f),_||(_=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();_=!1}).catch(d=>setTimeout(()=>{throw d})))},reset:()=>{a.setState(a.initialState)},setOptions:f=>{const d=Rt(f,a.options);a.options=s(d)},getState:()=>a.options.state,setState:f=>{a.options.onStateChange==null||a.options.onStateChange(f)},_getRowId:(f,d,m)=>{var p;return(p=a.options.getRowId==null?void 0:a.options.getRowId(f,d,m))!=null?p:`${m?[m.id,d].join("."):d}`},getCoreRowModel:()=>(a._getCoreRowModel||(a._getCoreRowModel=a.options.getCoreRowModel(a)),a._getCoreRowModel()),getRowModel:()=>a.getPaginationRowModel(),getRow:(f,d)=>{let m=(d?a.getPrePaginationRowModel():a.getRowModel()).rowsById[f];if(!m&&(m=a.getCoreRowModel().rowsById[f],!m))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${f}`):new Error;return m},_getDefaultColumnDef:we(()=>[a.options.defaultColumn],f=>{var d;return f=(d=f)!=null?d:{},{header:m=>{const p=m.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:m=>{var p,v;return(p=(v=m.renderValue())==null||v.toString==null?void 0:v.toString())!=null?p:null},...a._features.reduce((m,p)=>Object.assign(m,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...f}},ye(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>a.options.columns,getAllColumns:we(()=>[a._getColumnDefs()],f=>{const d=function(m,p,v){return v===void 0&&(v=0),m.map(y=>{const w=Zu(a,y,v,p),C=y;return w.columns=C.columns?d(C.columns,w,v+1):[],w})};return d(f)},ye(e,"debugColumns","getAllColumns")),getAllFlatColumns:we(()=>[a.getAllColumns()],f=>f.flatMap(d=>d.getFlatColumns()),ye(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:we(()=>[a.getAllFlatColumns()],f=>f.reduce((d,m)=>(d[m.id]=m,d),{}),ye(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:we(()=>[a.getAllColumns(),a._getOrderColumnsFn()],(f,d)=>{let m=f.flatMap(p=>p.getLeafColumns());return d(m)},ye(e,"debugColumns","getAllLeafColumns")),getColumn:f=>{const d=a._getAllFlatColumnsById()[f];return process.env.NODE_ENV!=="production"&&!d&&console.error(`[Table] Column with id '${f}' does not exist.`),d}};Object.assign(a,g);for(let f=0;f<a._features.length;f++){const d=a._features[f];d==null||d.createTable==null||d.createTable(a)}return a}function v_(){return e=>we(()=>[e.options.data],n=>{const t={rows:[],flatRows:[],rowsById:{}},o=function(a,i,s){i===void 0&&(i=0);const l=[];for(let u=0;u<a.length;u++){const _=Zr(e,e._getRowId(a[u],u,s),a[u],u,i,void 0,s?.id);if(t.flatRows.push(_),t.rowsById[_.id]=_,l.push(_),e.options.getSubRows){var c;_.originalSubRows=e.options.getSubRows(a[u],u),(c=_.originalSubRows)!=null&&c.length&&(_.subRows=o(_.originalSubRows,i+1,_))}}return l};return t.rows=o(n),t},ye(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function b_(e){const n=[],t=o=>{var a;n.push(o),(a=o.subRows)!=null&&a.length&&o.getIsExpanded()&&o.subRows.forEach(t)};return e.rows.forEach(t),{rows:n,flatRows:e.flatRows,rowsById:e.rowsById}}function w_(e,n,t){return t.options.filterFromLeafRows?y_(e,n,t):C_(e,n,t)}function y_(e,n,t){var o;const a=[],i={},s=(o=t.options.maxLeafRowFilterDepth)!=null?o:100,l=function(c,u){u===void 0&&(u=0);const _=[];for(let f=0;f<c.length;f++){var g;let d=c[f];const m=Zr(t,d.id,d.original,d.index,d.depth,void 0,d.parentId);if(m.columnFilters=d.columnFilters,(g=d.subRows)!=null&&g.length&&u<s){if(m.subRows=l(d.subRows,u+1),d=m,n(d)&&!m.subRows.length){_.push(d),i[d.id]=d,a.push(d);continue}if(n(d)||m.subRows.length){_.push(d),i[d.id]=d,a.push(d);continue}}else d=m,n(d)&&(_.push(d),i[d.id]=d,a.push(d))}return _};return{rows:l(e),flatRows:a,rowsById:i}}function C_(e,n,t){var o;const a=[],i={},s=(o=t.options.maxLeafRowFilterDepth)!=null?o:100,l=function(c,u){u===void 0&&(u=0);const _=[];for(let f=0;f<c.length;f++){let d=c[f];if(n(d)){var g;if((g=d.subRows)!=null&&g.length&&u<s){const p=Zr(t,d.id,d.original,d.index,d.depth,void 0,d.parentId);p.subRows=l(d.subRows,u+1),d=p}_.push(d),a.push(d),i[d.id]=d}}return _};return{rows:l(e),flatRows:a,rowsById:i}}function x_(){return e=>we(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(n,t,o)=>{if(!n.rows.length||!(t!=null&&t.length)&&!o){for(let f=0;f<n.flatRows.length;f++)n.flatRows[f].columnFilters={},n.flatRows[f].columnFiltersMeta={};return n}const a=[],i=[];(t??[]).forEach(f=>{var d;const m=e.getColumn(f.id);if(!m)return;const p=m.getFilterFn();if(!p){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${m.id}.`);return}a.push({id:f.id,filterFn:p,resolvedValue:(d=p.resolveFilterValue==null?void 0:p.resolveFilterValue(f.value))!=null?d:f.value})});const s=(t??[]).map(f=>f.id),l=e.getGlobalFilterFn(),c=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());o&&l&&c.length&&(s.push("__global__"),c.forEach(f=>{var d;i.push({id:f.id,filterFn:l,resolvedValue:(d=l.resolveFilterValue==null?void 0:l.resolveFilterValue(o))!=null?d:o})}));let u,_;for(let f=0;f<n.flatRows.length;f++){const d=n.flatRows[f];if(d.columnFilters={},a.length)for(let m=0;m<a.length;m++){u=a[m];const p=u.id;d.columnFilters[p]=u.filterFn(d,p,u.resolvedValue,v=>{d.columnFiltersMeta[p]=v})}if(i.length){for(let m=0;m<i.length;m++){_=i[m];const p=_.id;if(_.filterFn(d,p,_.resolvedValue,v=>{d.columnFiltersMeta[p]=v})){d.columnFilters.__global__=!0;break}}d.columnFilters.__global__!==!0&&(d.columnFilters.__global__=!1)}}const g=f=>{for(let d=0;d<s.length;d++)if(f.columnFilters[s[d]]===!1)return!1;return!0};return w_(n.rows,g,e)},ye(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function $_(e){return n=>we(()=>[n.getState().pagination,n.getPrePaginationRowModel(),n.options.paginateExpandedRows?void 0:n.getState().expanded],(t,o)=>{if(!o.rows.length)return o;const{pageSize:a,pageIndex:i}=t;let{rows:s,flatRows:l,rowsById:c}=o;const u=a*i,_=u+a;s=s.slice(u,_);let g;n.options.paginateExpandedRows?g={rows:s,flatRows:l,rowsById:c}:g=b_({rows:s,flatRows:l,rowsById:c}),g.flatRows=[];const f=d=>{g.flatRows.push(d),d.subRows.length&&d.subRows.forEach(f)};return g.rows.forEach(f),g},ye(n.options,"debugTable","getPaginationRowModel"))}function S_(){return e=>we(()=>[e.getState().sorting,e.getPreSortedRowModel()],(n,t)=>{if(!t.rows.length||!(n!=null&&n.length))return t;const o=e.getState().sorting,a=[],i=o.filter(c=>{var u;return(u=e.getColumn(c.id))==null?void 0:u.getCanSort()}),s={};i.forEach(c=>{const u=e.getColumn(c.id);u&&(s[c.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const l=c=>{const u=c.map(_=>({..._}));return u.sort((_,g)=>{for(let d=0;d<i.length;d+=1){var f;const m=i[d],p=s[m.id],v=p.sortUndefined,y=(f=m?.desc)!=null?f:!1;let w=0;if(v){const C=_.getValue(m.id),k=g.getValue(m.id),z=C===void 0,A=k===void 0;if(z||A){if(v==="first")return z?-1:1;if(v==="last")return z?1:-1;w=z&&A?0:z?v:-v}}if(w===0&&(w=p.sortingFn(_,g,m.id)),w!==0)return y&&(w*=-1),p.invertSorting&&(w*=-1),w}return _.index-g.index}),u.forEach(_=>{var g;a.push(_),(g=_.subRows)!=null&&g.length&&(_.subRows=l(_.subRows))}),u};return{rows:l(t.rows),flatRows:a,rowsById:t.rowsById}},ye(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 yt(e,t){return e?Wu(e)?E.createElement(e,t):e:null}function Wu(e){return Ku(e)||typeof e=="function"||Uu(e)}function Ku(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Uu(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Xu(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=E.useState(()=>({current:Pu(t)})),[o,r]=E.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...e,state:{...o,...e.state},onStateChange:a=>{r(a),e.onStateChange==null||e.onStateChange(a)}})),n.current}const Ne={checkbox_container:"_checkbox_container_3c4gu_1",checkbox_wrapper:"_checkbox_wrapper_3c4gu_13",label_text:"_label_text_3c4gu_33",hint_text:"_hint_text_3c4gu_51",checkbox:"_checkbox_3c4gu_1",input:"_input_3c4gu_99",checkbox_svg:"_checkbox_svg_3c4gu_153",custom_icon:"_custom_icon_3c4gu_195",checked:"_checked_3c4gu_225",indeterminate:"_indeterminate_3c4gu_227",radius_none:"_radius_none_3c4gu_235",radius_sm:"_radius_sm_3c4gu_243",radius_md:"_radius_md_3c4gu_251",radius_lg:"_radius_lg_3c4gu_259",radius_full:"_radius_full_3c4gu_267",sm:"_sm_3c4gu_275",lg:"_lg_3c4gu_301",secondary:"_secondary_3c4gu_327",success:"_success_3c4gu_335",warning:"_warning_3c4gu_343",danger:"_danger_3c4gu_351",solid:"_solid_3c4gu_377",outline:"_outline_3c4gu_391",disabled:"_disabled_3c4gu_439",readonly:"_readonly_3c4gu_509",no_animation:"_no_animation_3c4gu_589",line_through:"_line_through_3c4gu_607",lineThrough:"_lineThrough_3c4gu_1",checkbox_group:"_checkbox_group_3c4gu_651",label:"_label_3c4gu_33",marca_requerido:"_marca_requerido_3c4gu_679",description:"_description_3c4gu_687",checkboxes:"_checkboxes_3c4gu_701",vertical:"_vertical_3c4gu_711",horizontal:"_horizontal_3c4gu_719",grid:"_grid_3c4gu_727",error_message:"_error_message_3c4gu_737",invalid:"_invalid_3c4gu_749"},ua=m.createContext(null),fa=()=>m.useContext(ua),Ct=m.forwardRef((e,t)=>{const{children:n,label:o,hint:r,isSelected:s,defaultChecked:a,isIndeterminate:l=!1,isDisabled:d=!1,isReadOnly:u=!1,isRequired:_=!1,lineThrough:p=!1,onlyIcon:f=!1,disableAnimation:c=!1,customCheckIcon:h,size:g="md",color:v="primary",customColor:w,radius:y="md",variant:x="solid",className:k="",classNames:L={},onChange:A,value:M,name:T,id:P,...I}=e,q=fa(),V=m.useId(),S=P||V,b=m.useRef(null),$=s!==void 0,[D,N]=m.useState(a??!1),C=!!q,z=C&&M?q.value.includes(M):!1,O=C?z:$?s:D,W=!!q?.maxSelectionReached&&!O,G=d||q?.isDisabled||W,F=u||q?.isReadOnly,j=q?!1:_,B=T||q?.name;m.useEffect(()=>{const R=b.current||(t&&typeof t=="object"?t.current:null);R&&(R.indeterminate=l??!1)},[l,t]);const te=R=>{if(G||F)return;const ge=R.target.checked;C&&M?q.onChange(M):($||N(ge),A?.(ge))},Z=o||n;return i.jsxs("div",{className:X(Ne.checkbox_container,{[Ne.disabled]:G,[Ne.readonly]:F},L.base,k),children:[i.jsxs("label",{className:X(Ne.checkbox_wrapper,Ne[g],!w&&Ne[v],Ne[x],Ne[`radius_${y}`],{[Ne.checked]:O,[Ne.indeterminate]:l,[Ne.disabled]:G,[Ne.readonly]:F,[Ne.line_through]:p&&O,[Ne.no_animation]:c}),style:w?{"--checkbox-custom-color":w}:void 0,children:[i.jsxs("span",{className:Ne.checkbox,children:[i.jsx("input",{ref:R=>{b.current=R,typeof t=="function"?t(R):t&&(t.current=R)},id:S,type:"checkbox",className:Ne.input,checked:O,onChange:te,disabled:G,readOnly:F,required:j,value:M,name:B,...I}),h?i.jsx("span",{className:Ne.custom_icon,children:h}):i.jsx("svg",{className:Ne.checkbox_svg,viewBox:"0 0 22 22","aria-hidden":"true",children:i.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"})})]}),!f&&Z&&i.jsx("span",{className:X(Ne.label_text,L.label),children:Z})]}),r&&i.jsx("span",{className:X(Ne.hint_text,L.label),children:r})]})});Ct.displayName="Checkbox";const _a=({label:e,children:t,description:n,errorMessage:o,isInvalid:r=!1,orientation:s="vertical",className:a,value:l,defaultValue:d=[],onChange:u,isDisabled:_=!1,isReadOnly:p=!1,isRequired:f=!1,minSelection:c,maxSelection:h,requiredMessage:g,name:v,options:w,optionValueKey:y,optionLabelKey:x,optionDisabledKey:k,optionDescriptionKey:L,columns:A})=>{const M=l!==void 0,[T,P]=m.useState(d),I=M?l:T,q=m.useRef(null),V=f?c??1:c??0,S=h!==void 0&&I.length>=h;m.useEffect(()=>{if(!q.current||V===0)return;V-I.length<=0?q.current.setCustomValidity(""):q.current.setCustomValidity(g??(V===1?"Selecciona al menos una opción":`Selecciona al menos ${V} opciones`))},[I,V,g]);const b=D=>{if(_||p)return;const N=I.includes(D);if(!N&&S)return;const C=N?I.filter(z=>z!==D):[...I,D];M||P(C),u?.(C)},$=i.jsx("input",{ref:q,type:"checkbox",required:!0,checked:I.length>=V,onChange:()=>{},"aria-hidden":"true",tabIndex:-1,style:{height:"1px",left:0,opacity:0,pointerEvents:"none",position:"absolute",top:"100%",width:"1px"}});return i.jsxs("div",{className:X(Ne.checkbox_group,Ne[s],{[Ne.invalid]:r,[Ne.disabled]:_,[Ne.readonly]:p},a),role:"group","aria-required":f||V>0,"aria-invalid":r,children:[V>0&&!e&&$,e&&i.jsxs("div",{className:Ne.label,style:{position:"relative"},children:[e,(f||V>0)&&i.jsx("span",{className:Ne.marca_requerido,children:" *"}),V>0&&$]}),n&&i.jsx("div",{className:Ne.description,children:n}),i.jsx(ua.Provider,{value:{value:I,onChange:b,isDisabled:_,isReadOnly:p,isRequired:f,name:v,maxSelectionReached:S},children:i.jsx("div",{className:X(Ne.checkboxes,!A&&Ne[s],A&&Ne.grid),style:A?{gridTemplateColumns:typeof A=="number"?`repeat(${A}, 1fr)`:A}:void 0,children:w&&w.length>0?w.map((D,N)=>{let C,z,O=!1,W;if(typeof D=="object"&&D!==null){const G=y??"value",F=x??"label",j=k??"isDisabled",B=L??"description",te=D[G];C=String(te!==void 0?te:N),z=D[F];const Z=D[j];O=typeof Z=="boolean"?Z:!1;const R=D[B];W=typeof R=="string"?R:void 0}else C=String(D),z=D;return i.jsx(Ct,{value:C,isDisabled:O,hint:W,children:z},C)}):t})}),o&&r&&i.jsx("div",{className:Ne.error_message,children:o})]})};_a.displayName="CheckboxGroup";const qe={contenedor:"_contenedor_6kgne_1",contenedor_superior:"_contenedor_superior_6kgne_17",input_con_icono:"_input_con_icono_6kgne_35",icono_busqueda:"_icono_busqueda_6kgne_49",input_busqueda:"_input_busqueda_6kgne_75",contenedor_acciones_botones:"_contenedor_acciones_botones_6kgne_147",contenedor_acciones:"_contenedor_acciones_6kgne_147",columna:"_columna_6kgne_183",encabezados:"_encabezados_6kgne_203",contenido_encabezado:"_contenido_encabezado_6kgne_229",icono_orden:"_icono_orden_6kgne_243",boton_basico:"_boton_basico_6kgne_313",texto_filtros:"_texto_filtros_6kgne_337",menu_configuraciones:"_menu_configuraciones_6kgne_369",tabla_card:"_tabla_card_6kgne_417",wrapper_scroll_tabla:"_wrapper_scroll_tabla_6kgne_429",contenedor_tabla:"_contenedor_tabla_6kgne_443",contenedor_datos:"_contenedor_datos_6kgne_457",datos:"_datos_6kgne_491",seleccionada:"_seleccionada_6kgne_539",boton_acciones:"_boton_acciones_6kgne_599"};function Yu(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 s=Math.min(n,t);return Array.from({length:s},(a,l)=>r+l)}function Zu(e,t){return t===0?0:e>=t?t-1:e<0?0:e}function xt(e,t){const n=new Map;t.getFlatHeaders().forEach(a=>n.set(a.column.id,a));const o=n.get(e);if(o)return yt(o.column.columnDef.header,o.getContext());const r=t.getAllLeafColumns().find(a=>a.id===e),s=r?.columnDef.header;return typeof s=="string"||typeof s=="number"?s:r?.id??e}function ga(e,t){const n=e.getVisibleCells().find(o=>o.column.id===t);return n?yt(n.column.columnDef.cell,n.getContext()):null}function pa(e,t){return t?e.getVisibleCells().map(o=>o.column.id).includes(t):!1}function Ju(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 Kr(e[0].nombre.toLowerCase());if(t===2)return`${Kr(e[0].nombre.toLowerCase())}, ${e[1].nombre.toLowerCase()}`;const n=e.slice(0,2).map(r=>r.nombre.toLowerCase()),o=t-2;return`${Kr(n.join(", "))} y ${o>1?`otros ${o}`:"otro"} más`}function Kr(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function ha(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}const ma=m.createContext(null),Ur=ma;function Po(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function Ru({children:e,data:t,columns:n,controls:o,loading:r,primerasColumnas:s,tamanioPaginaInicial:a=10,filtros:l,descargarExcel:d,actualizarTabla:u,selectorFilas:_=[],sinDatosProps:p,maxColumnasVisibles:f=10,...c}){const[h,g]=m.useState(""),v=Bd(h,200),w=Ir("only screen and (max-width: 830px)"),[y,x]=m.useState({pageIndex:0,pageSize:a}),[k,L]=m.useState({}),A=m.useMemo(()=>{const F={},j=new Set;n.forEach(te=>{const Z="accessorKey"in te?String(te.accessorKey):te.id;Z&&te.meta?.isHidden&&(F[Z]=!1,j.add(Z))});let B=0;return n.forEach(te=>{const Z="accessorKey"in te?String(te.accessorKey):te.id;!Z||j.has(Z)||(B<f?B++:F[Z]=!1)}),F},[n,f]),[M,T]=m.useState(()=>A);m.useEffect(()=>{T(A)},[A]);const P=m.useMemo(()=>{const F=[];return _.length>0&&!w&&F.push({id:"select",header:({table:j})=>i.jsx(Ct,{color:"secondary",isSelected:j.getIsAllPageRowsSelected(),isIndeterminate:j.getIsSomePageRowsSelected()&&!j.getIsAllPageRowsSelected(),onChange:B=>j.toggleAllPageRowsSelected(!!B)}),cell:({row:j})=>i.jsx(Ct,{color:"primary",isSelected:j.getIsSelected(),isDisabled:!j.getCanSelect(),onChange:B=>j.toggleSelected(B)}),enableSorting:!1,enableHiding:!1}),F.push(...n),o?.length&&F.push({id:"actions",header:"Acciones",cell:j=>i.jsx("div",{className:qe.contenedor_acciones,children:o.filter(B=>!B.visible||B.visible(j.row.original)).map(B=>"contenido"in B?i.jsx(lt,{content:B.nombre,variant:"default",size:"sm",placement:"top",children:i.jsx("span",{children:B.contenido(j.row.original,qe.boton_acciones)})},B.id):i.jsx(lt,{content:B.nombre,variant:"default",size:"sm",placement:"top",children:i.jsx(nn,{id:B.id,size:"sm",radius:"md",variant:"light",isIconOnly:!0,onClick:()=>B.evento(j.row.original),className:qe.boton_acciones,children:B.icono})},B.id))}),enableSorting:!1,enableHiding:!1}),F},[n,o,_.length,w]),I=m.useMemo(()=>{const F=P.map(B=>"accessorKey"in B&&B.accessorKey!=null?String(B.accessorKey):"id"in B&&B.id!=null?String(B.id):"").filter(Boolean),j=F.indexOf("actions");return j>-1&&j<F.length-1&&(F.splice(j,1),F.push("actions")),F},[P]),[q,V]=m.useState(()=>I);m.useEffect(()=>{V(F=>Po(F,I)?F:I)},[I]);const S=m.useCallback((F,j,B)=>{if(!B)return!0;const te=ha(String(B)),Z=F.getValue(j);return Z==null?!1:ha(String(Z)).includes(te)},[]),b=Xu({data:t,columns:P,state:{pagination:y,globalFilter:v,columnOrder:q,rowSelection:k,columnVisibility:M},onColumnVisibilityChange:T,globalFilterFn:S,enableRowSelection:_.length>0,onRowSelectionChange:L,onPaginationChange:x,onColumnOrderChange:F=>{V(j=>{const B=typeof F=="function"?F(j):F;return Po(j,B)?j:B})},getCoreRowModel:Tu(),getSortedRowModel:Gu(),getFilteredRowModel:Bu(),getPaginationRowModel:Hu(),autoResetPageIndex:!1}),$=b.getPageCount();m.useEffect(()=>{const F=Zu(y.pageIndex,$);F!==y.pageIndex&&x(j=>({...j,pageIndex:F}))},[y.pageIndex,$]);const D=m.useRef(v);m.useEffect(()=>{D.current!==v&&x(j=>j.pageIndex===0?j:{...j,pageIndex:0}),D.current=v},[v]);const N=m.useMemo(()=>b.getAllLeafColumns().filter(F=>F.id!=="actions"&&F.id!=="select"&&F.getCanHide?.()),[b]),C=m.useCallback(F=>{const B=n.find(te=>"accessorKey"in te?String(te.accessorKey)===F:String(te.id)===F)?.header;return typeof B=="string"||typeof B=="number"?String(B):F},[n]),z=m.useCallback(()=>{T(A),b.setPageSize(a),b.setPageIndex(0),b.resetRowSelection(),V(F=>Po(F,I)?F:I)},[b,a,I,A]),O=m.useCallback(F=>{const j=Math.max(1,Math.min(200,F));b.setPageSize(j),b.setPageIndex(0)},[b]),W=m.useCallback(F=>{V(j=>{const B=typeof F=="function"?F(j):F;return Po(j,B)?j:B})},[]),G=m.useMemo(()=>({state:{ordenColumnas:q,table:b,columns:P,controls:o,loading:r,primerasColumnas:[String(s[0]),String(s[1])],inputBusqueda:h,setInputBusqueda:g,filtros:l,descargarExcel:d,actualizarTabla:u,selectorFilas:_,sinDatosProps:p,maxColumnasVisibles:f,...c},todasLasColumnas:N,etiquetaColumna:C,restaurarConfiguracion:z,cambiarPageSize:O,cambiarOrdenColumnas:W}),[q,b,P,o,r,h,l,s,d,u,_,p,f,c,N,C,z,O,W]);return i.jsx(ma.Provider,{value:G,children:e})}function ef(){const e=m.useContext(Ur);if(!e)throw new Error("useTablaContext debe usarse dentro de TablaDatosProvider");return e}function Jn(){const e=m.useContext(Ur);return e||null}const jn={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 va(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6l6 6z"})})}function ba(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.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 nf(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.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 tf(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.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 of(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M10.97 20.344L9 21v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4h16v2.172a2 2 0 0 1-.586 1.414L15 12v1.5m3.42 2.11a2.1 2.1 0 0 1 2.97 2.97L18 22h-3v-3z"})})}function rf(e){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",...e,children:[i.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"}),i.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 sf(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[i.jsx("circle",{cx:"12",cy:"12",r:"3"}),i.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 af(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:i.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 lf(e){return i.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",...e,children:[i.jsx("circle",{cx:"5.5",cy:"4",r:"1.2",fill:"currentColor"}),i.jsx("circle",{cx:"5.5",cy:"8",r:"1.2",fill:"currentColor"}),i.jsx("circle",{cx:"5.5",cy:"12",r:"1.2",fill:"currentColor"}),i.jsx("circle",{cx:"10.5",cy:"4",r:"1.2",fill:"currentColor",opacity:".35"}),i.jsx("circle",{cx:"10.5",cy:"8",r:"1.2",fill:"currentColor",opacity:".35"}),i.jsx("circle",{cx:"10.5",cy:"12",r:"1.2",fill:"currentColor",opacity:".35"})]})}function cf(e){return i.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[i.jsx("rect",{x:"3",y:"3",width:"4",height:"14",rx:"1",fill:"currentColor"}),i.jsx("rect",{x:"8",y:"3",width:"9",height:"14",rx:"1",fill:"currentColor",opacity:".3"})]})}function df(e){return i.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[i.jsx("rect",{x:"3",y:"3",width:"14",height:"4",rx:"1",fill:"currentColor"}),i.jsx("rect",{x:"3",y:"8",width:"14",height:"9",rx:"1",fill:"currentColor",opacity:".3"})]})}function uf(e){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",...e,children:[i.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor",opacity:".2"}),i.jsx("path",{fill:"currentColor",d:"M13 7a1 1 0 1 0-2 0v4H7a1 1 0 1 0 0 2h4v4a1 1 0 1 0 2 0v-4h4a1 1 0 1 0 0-2h-4V7Z"})]})}function ff(e){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:[i.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor",opacity:".2"}),i.jsx("path",{fill:"currentColor",d:"M7 12a1 1 0 0 1 1-1h8a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1Z"})]})}function _f(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:i.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"})})}function gf(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",...e,children:i.jsxs("g",{fill:"none",children:[i.jsx("path",{fill:"currentColor",d:"M7.378 11.63h-.75zm0 .926l-.562.497a.75.75 0 0 0 1.08.044zm2.141-1.015a.75.75 0 0 0-1.038-1.082zm-2.958-1.038a.75.75 0 1 0-1.122.994zm8.37-1.494a.75.75 0 1 0 1.102-1.018zM12.045 6.25c-2.986 0-5.416 2.403-5.416 5.38h1.5c0-2.137 1.747-3.88 3.916-3.88zm-5.416 5.38v.926h1.5v-.926zm1.269 1.467l1.622-1.556l-1.038-1.082l-1.622 1.555zm.042-1.039l-1.378-1.555l-1.122.994l1.377 1.556zm8.094-4.067a5.42 5.42 0 0 0-3.99-1.741v1.5a3.92 3.92 0 0 1 2.889 1.26zm.585 3.453l.56-.498a.75.75 0 0 0-1.08-.043zm-2.139 1.014a.75.75 0 1 0 1.04 1.082zm2.96 1.04a.75.75 0 0 0 1.12-.997zm-8.393 1.507a.75.75 0 0 0-1.094 1.026zm2.888 2.745c2.993 0 5.434-2.4 5.434-5.38h-1.5c0 2.135-1.753 3.88-3.934 3.88zm5.434-5.38v-.926h-1.5v.926zm-1.27-1.467l-1.619 1.555l1.04 1.082l1.618-1.555zm-.04 1.04l1.38 1.554l1.122-.996l-1.381-1.555zM7.952 16.03a5.45 5.45 0 0 0 3.982 1.719v-1.5c-1.143 0-2.17-.48-2.888-1.245z"}),i.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",opacity:".5"})]})})}function pf(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",role:"button",...e,children:i.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"})})}function hf(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",role:"button",...e,children:i.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"})})}const mf=({titulo:e,onBack:t})=>i.jsxs("header",{className:jn.header,children:[i.jsx(nn,{isIconOnly:!0,variant:"light",onClick:t,"aria-label":"Regresar",children:i.jsx(va,{})}),i.jsx("h3",{className:jn.titulo,children:e})]}),Qn={contenedor:"_contenedor_1leqv_1",lista:"_lista_1leqv_13",item:"_item_1leqv_45",item_dragging:"_item_dragging_1leqv_75",item_deshabilitado:"_item_deshabilitado_1leqv_85",icono_drag:"_icono_drag_1leqv_95",nombre:"_nombre_1leqv_147",checkbox:"_checkbox_1leqv_177"};function vf(){const e=Jn(),[t,n]=m.useState(null);if(!e)return null;const{state:o,todasLasColumnas:r,etiquetaColumna:s,cambiarOrdenColumnas:a}=e,{ordenColumnas:l,maxColumnasVisibles:d=10}=o,_=r.filter(h=>h.getIsVisible()).length>=d,p=h=>g=>{n(h),g.dataTransfer.effectAllowed="move",g.dataTransfer.setData("text/plain",h)},f=h=>g=>{g.preventDefault(),!(!t||t===h)&&a?.(v=>{const w=[...v],y=w.indexOf(t),x=w.indexOf(h);return y===-1||x===-1?v:(w.splice(y,1),w.splice(x,0,t),w)})},c=()=>n(null);return i.jsx("div",{className:Qn.contenedor,children:i.jsx("ul",{className:Qn.lista,children:l.map(h=>{const g=r.find(k=>k.id===h);if(!g)return null;const v=g.getCanHide?.()??!0,w=g.getIsVisible(),y=t===g.id,x=!v||!w&&_;return i.jsxs("li",{className:`${Qn.item} ${y?Qn.item_dragging:""} ${x?Qn.item_deshabilitado:""}`,draggable:!x,onDragStart:p(g.id),onDragOver:f(g.id),onDrop:c,onDragEnd:c,title:!w&&_?`Límite de ${d} columnas visibles alcanzado`:void 0,children:[i.jsx("span",{className:Qn.icono_drag,"aria-label":"Arrastrar columna",children:i.jsx(lf,{})}),i.jsx("span",{className:Qn.nombre,children:s(g.id)}),i.jsx(Ct,{size:"md",color:"primary",isSelected:w,isDisabled:x,onChange:k=>g.toggleVisibility(k),className:Qn.checkbox})]},g.id)})})})}const jt={contenido:"_contenido_1oed5_1",descripcion:"_descripcion_1oed5_15",control:"_control_1oed5_31",valor:"_valor_1oed5_45",input:"_input_1oed5_67"};function bf(){const e=Jn(),[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:s}=e,a=p=>Math.max(Xr,Math.min(Yr,p)),l=p=>{const f=r+p;f>=Xr&&f<=Yr&&s?.(f)},d=()=>{const p=parseInt(t,10),f=!isNaN(p)&&p>0?a(p):r;s?.(f),n(String(f))},u=p=>{({Enter:()=>{d(),o.current?.blur()},Escape:()=>{n(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]?.()},_=p=>{const f=p.target.value;(f===""||/^\d+$/.test(f))&&n(f)};return i.jsxs("div",{className:jt.contenido,children:[i.jsx("p",{className:jt.descripcion,children:"Ajusta la cantidad de filas que se muestran por página en la tabla."}),i.jsxs("div",{className:jt.control,children:[i.jsx(nn,{isIconOnly:!0,radius:"lg",variant:"light",onClick:()=>l(-1),"aria-label":"Disminuir filas",disabled:r<=Xr,children:i.jsx(ff,{style:{fontSize:"var(--gaps-6)"}})}),i.jsx("div",{className:jt.valor,children:i.jsx("input",{ref:o,type:"text",inputMode:"numeric",value:t,onChange:_,onKeyDown:u,onFocus:()=>o.current?.select(),onBlur:d,className:jt.input,"aria-label":"Número de filas por página"})}),i.jsx(nn,{isIconOnly:!0,radius:"lg",variant:"light",onClick:()=>l(1),"aria-label":"Aumentar filas",disabled:r>=Yr,children:i.jsx(uf,{})})]})]})}const gn={contenedor:"_contenedor_1lwmx_1",menu:"_menu_1lwmx_11",item:"_item_1lwmx_25",icono_contenedor:"_icono_contenedor_1lwmx_111",icono_restaurar:"_icono_restaurar_1lwmx_143",texto:"_texto_1lwmx_153",nombre:"_nombre_1lwmx_165",descripcion:"_descripcion_1lwmx_183",chevron:"_chevron_1lwmx_201",divider:"_divider_1lwmx_227"};function wf({navegar:e}){const t=Jn();return i.jsxs("div",{className:gn.contenedor,children:[i.jsx("nav",{className:gn.menu,children:xf.map(({id:n,icono:o,nombre:r,descripcion:s})=>i.jsxs("button",{className:gn.item,onClick:()=>e(n),children:[i.jsx("div",{className:gn.icono_contenedor,children:i.jsx(o,{})}),i.jsxs("div",{className:gn.texto,children:[i.jsx("span",{className:gn.nombre,children:r}),i.jsx("span",{className:gn.descripcion,children:s})]}),i.jsx(ba,{className:gn.chevron})]},n))}),i.jsx("div",{className:gn.divider}),i.jsx("div",{className:gn.menu,children:i.jsxs("button",{className:gn.item,onClick:t?.restaurarConfiguracion,children:[i.jsx("div",{className:gn.icono_contenedor,children:i.jsx(af,{className:gn.icono_restaurar})}),i.jsxs("div",{className:gn.texto,children:[i.jsx("span",{className:gn.nombre,children:"Restaurar configuración"}),i.jsx("span",{className:gn.descripcion,children:"Volver a valores por defecto"})]})]})})]})}const Xr=1,Yr=200,wa=250,yf=200,Cf={panelPrincipal:{component:wf},panelColumnas:{component:vf,titulo:"Columnas visibles"},panelFilas:{component:bf,titulo:"Filas por página"}},xf=[{id:"panelColumnas",icono:cf,nombre:"Columnas visibles",descripcion:"Mostrar u ocultar columnas"},{id:"panelFilas",icono:df,nombre:"Filas por página",descripcion:"Ajustar cantidad de filas"}];function $f(e,t,n){const o=m.useRef(n);o.current=n;const r=m.useRef(e);r.current=e;const s=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",s)},100);return()=>{clearTimeout(a),document.removeEventListener("mousedown",s)}},[t,s])}function ya(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 Sf(e,t,n,{width:o,offsetRight:r=0,offsetLeft:s=0,offsetTop:a=0,offsetBottom:l=0,shiftPadding:d=8}){const[u,_]=m.useState({top:0,left:0}),p=Ir("only screen and (max-width: 480px)"),f=m.useCallback(()=>{if(!e.current)return{top:0,left:0};const c=e.current.getBoundingClientRect(),h=d;let g=c.bottom+a,v=0;p?v=c.right-o-s+r:v=c.right-o+r-s;const w=t.current?.offsetHeight||400;g+w>window.innerHeight-h&&(g=c.top-w-l,g<h&&(g=h));const y=h,x=window.innerWidth-o-h;return v=Math.max(y,Math.min(v,x)),{top:g,left:v}},[p,o,r,s,a,l,d,e,t]);return m.useEffect(()=>{if(!n||!e.current)return;const c=()=>{_(f())};return c(),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0),()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0)}},[n,f,e]),u}function kf(e){m.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e])}function If(){const[e,t]=m.useState(!1),[n,o]=m.useState(!1),[r,s]=m.useState("panelPrincipal"),[a,l]=m.useState(null),d=m.useRef(null),u=m.useRef(null),_=m.useRef(null);kf(n),$f(()=>f(),n,[d,u]),ya(()=>f(),n);const p=Sf(d,u,n,{width:wa,offsetRight:6,offsetTop:-2,shiftPadding:8});m.useEffect(()=>{e&&(o(!0),l(null))},[e]),m.useEffect(()=>()=>{_.current&&clearTimeout(_.current)},[]);function f(){n&&(t(!1),_.current=window.setTimeout(()=>{o(!1),s("panelPrincipal"),l(null)},yf))}function c(v){l(v==="panelPrincipal"?"backward":"forward"),s(v)}const h=Cf[r],g=h.component;return i.jsxs("div",{ref:d,className:jn.contenedor,children:[i.jsx(nn,{isIconOnly:!0,variant:"light",onClick:()=>n?f():t(!0),"aria-haspopup":"dialog","aria-expanded":n,"aria-label":"Configurar tabla",children:i.jsx(sf,{})}),n&&d.current&&St.createPortal(i.jsx("div",{ref:u,className:`${jn.popover} ${e?jn.popover_entrada:jn.popover_salida}`,role:"dialog",style:{top:`${p.top}px`,left:`${p.left}px`,width:wa},children:i.jsx("div",{className:jn.ventana,children:i.jsxs("div",{className:X([jn.panel,jn[`panel_${a}`]]),children:[h.titulo&&i.jsx(mf,{titulo:h.titulo,onBack:()=>c("panelPrincipal")}),i.jsx(g,{navegar:c})]},r)})}),document.body)]})}function Ef(){const e=Jn();if(!e)return null;const{state:t}=e,{inputBusqueda:n,setInputBusqueda:o,loading:r,filtros:s,actualizarTabla:a,descargarExcel:l,paginacion:d}=t,{abrirFiltros:u,filtrosAplicados:_=[]}=s||{},p=_?.length||0;return i.jsxs("section",{className:qe.contenedor_superior,children:[i.jsxs("div",{className:qe.input_con_icono,id:"buscador-tabla",children:[i.jsx(nf,{className:qe.icono_busqueda}),i.jsx("input",{type:"text",placeholder:"Buscar en tabla...",value:n??"",onChange:f=>o&&o(f.target.value),className:qe.input_busqueda})]}),i.jsxs("div",{className:qe.contenedor_acciones_botones,children:[i.jsxs("div",{className:qe.contenedor_acciones,children:[d?.hayMasDatos&&i.jsxs(nn,{id:"cargar-mas-datos",variant:"light",className:qe.boton_basico,disabled:r,onClick:d.onCargarMasDatos,children:[i.jsx(gf,{}),r?"Actualizando...":"Más datos"]}),u!==void 0&&i.jsxs(nn,{id:"boton-filtros",onClick:u,variant:"light",className:qe.boton_basico,children:[i.jsx(of,{})," Filtros"]}),p>0?i.jsxs("div",{className:qe.texto_filtros,id:"filtros-aplicados",children:[i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.4em",height:"1.4em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6h16M6 12h12m-9 6h2m4 0l2 2l4-4"})}),i.jsx("p",{children:Qu(_,p)})]}):null]}),l!==void 0?i.jsxs(nn,{onClick:l,color:"success",variant:"faded",children:[i.jsx(tf,{})," Excel"]}):null]}),i.jsxs("div",{className:qe.contenedor_acciones,children:[a!==void 0&&i.jsx(lt,{content:"Actualiza los últimos datos guardados",children:i.jsx(nn,{id:"actualizar-tabla",variant:"light",isIconOnly:!0,className:qe.boton_basico,disabled:a?.cargando,onClick:a?.onClick,children:i.jsx(rf,{})})}),i.jsx("div",{className:qe.menu_configuraciones,id:"configuraciones-tabla",children:i.jsx(If,{})})]})]})}const An={contenedor_paginacion:"_contenedor_paginacion_1dr00_1",info_paginacion:"_info_paginacion_1dr00_12",contenedor_botones:"_contenedor_botones_1dr00_20",boton_paginacion:"_boton_paginacion_1dr00_49",pagina_activa:"_pagina_activa_1dr00_72",boton_num_paginacion:"_boton_num_paginacion_1dr00_78"};function Mf(){const e=Jn();if(!e)return null;const{state:t}=e,{table:n}=t,o=n.getPrePaginationRowModel().rows.length,r=n.getPageCount()||1,{pageIndex:s}=n.getState().pagination,a=s+1,l=Yu(a,r),d=n.getCanPreviousPage(),u=n.getCanNextPage(),_=r>1,p=s===0,f=s===r-1,c=()=>{d&&n.previousPage()},h=()=>{u&&n.nextPage()},g=y=>{n.setPageIndex(y-1)},v=()=>{p||n.firstPage()},w=()=>{f||n.lastPage()};return i.jsxs("section",{className:An.contenedor_paginacion,id:"paginacion-tabla",children:[i.jsxs("p",{className:An.info_paginacion,id:"paginacion-total-documentos",children:["Documentos: ",o]}),_&&i.jsxs("div",{className:An.contenedor_botones,id:"paginacion-numerador-pags",children:[!p&&i.jsx(pf,{id:"paginacion-flecha-inicio",onClick:v,"aria-label":"Ir a la primera página","aria-disabled":p,className:An.boton_paginacion}),d&&i.jsx(va,{id:"paginacion-flecha-izq",onClick:c,"aria-disabled":!d,className:An.boton_paginacion}),i.jsx("div",{id:"paginacion-numero-pag",children:l.map(y=>i.jsx("button",{type:"button",onClick:()=>g(y),"aria-current":y===a?"page":void 0,className:y===a?An.pagina_activa:An.boton_num_paginacion,children:y},y))}),u&&i.jsx(ba,{id:"paginacion-flecha-der",onClick:h,"aria-disabled":!u,className:An.boton_paginacion}),!f&&i.jsx(hf,{id:"paginacion-flecha-fin",onClick:w,"aria-label":"Ir a la última página","aria-disabled":f,className:An.boton_paginacion})]}),i.jsxs("p",{className:An.info_paginacion,id:"paginacion-total-pags",children:["Página ",a," de ",r]})]})}const Me={contenedor_tabla_cards:"_contenedor_tabla_cards_zuvsb_1",contenedor_card:"_contenedor_card_zuvsb_11",contenedor_encabezado_card:"_contenedor_encabezado_card_zuvsb_25",contenedor_columna_card:"_contenedor_columna_card_zuvsb_47",card_label:"_card_label_zuvsb_57",card_valor:"_card_valor_zuvsb_69",card_segundo_valor:"_card_segundo_valor_zuvsb_83",contenedor_contenido_cards:"_contenedor_contenido_cards_zuvsb_93",contenedor_fila_card:"_contenedor_fila_card_zuvsb_105",card_fila_label:"_card_fila_label_zuvsb_119",card_fila_valor:"_card_fila_valor_zuvsb_137",contenedor_acciones_card:"_contenedor_acciones_card_zuvsb_153",boton_acciones:"_boton_acciones_zuvsb_171",boton_card:"_boton_card_zuvsb_207",boton_personalizado:"_boton_personalizado_zuvsb_237"};function Ca(e,t){if(t)return e.find(n=>n.accessorKey===t||n.id!==void 0&&n.id===String(t))}function xa(e){if(e)return e.id??e.accessorKey}const Bn={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 Nf({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 i.jsx("section",{className:Me.contenedor_tabla_cards,children:Array.from({length:e}).map((d,u)=>i.jsxs("article",{className:Me.contenedor_card,children:[i.jsxs("div",{className:Me.contenedor_encabezado_card,children:[i.jsx("div",{className:Me.contenedor_columna_card,children:o&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:Me.card_label,children:xt(o,n)}),i.jsx("div",{className:Me.card_valor,children:i.jsx("div",{className:`${Bn.skeleton_elemento} ${Bn.skeleton_elemento_encabezado}`})})]})}),i.jsx("div",{className:Me.contenedor_columna_card,children:r&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:Me.card_label,children:xt(r,n)}),i.jsx("div",{className:Me.card_segundo_valor,children:i.jsx("div",{className:`${Bn.skeleton_elemento} ${Bn.skeleton_elemento_encabezado_segundo}`})})]})})]}),i.jsx("div",{className:Me.contenedor_contenido_cards,children:a.map((_,p)=>i.jsxs("div",{className:Me.contenedor_fila_card,children:[i.jsx("div",{className:Me.card_fila_label,children:xt(_.id,n)}),i.jsx("div",{className:Me.card_fila_valor,children:i.jsx("div",{className:`${Bn.skeleton_elemento} ${Bn.skeleton_elemento_contenido}`,style:{width:l[p%l.length]}})})]},_.id))}),t>0&&i.jsx("div",{className:Me.contenedor_acciones_card,children:Array.from({length:Math.min(t,3)}).map((_,p)=>i.jsx("div",{className:Bn.skeleton_accion,children:i.jsx("div",{className:`${Bn.skeleton_elemento} ${Bn.skeleton_elemento_encabezado}`})},`accion-${p}`))})]},`skeleton-card-${u}`))})}const ct={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"};function $a(){const e=m.useContext(Ur),{sinDatosProps:t}=e?.state||{},{botonAccion:n,titulo:o="No se encontraron coincidencias",descripcion:r='Usa el botón "Filtros" para ampliar tu búsqueda.'}=t||{};return i.jsxs("div",{className:ct.contenedor,children:[i.jsx(Ff,{}),i.jsxs("div",{className:ct.envolvedor_contenido,children:[i.jsx(Af,{}),i.jsx("h3",{className:ct.titulo,children:o}),i.jsx("p",{className:ct.descripcion,children:r}),n]})]})}function Ff(){return i.jsx("div",{className:ct.envolvedor_cuadricula,children:i.jsxs("svg",{className:ct.svg_cuadricula,width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("defs",{children:i.jsx("pattern",{id:"patronCuadricula",width:"40",height:"40",patternUnits:"userSpaceOnUse",children:i.jsx("path",{d:"M 40 0 L 0 0 0 40",fill:"none",stroke:"currentColor",strokeWidth:"1"})})}),i.jsx("rect",{width:"100%",height:"100%",fill:"url(#patronCuadricula)"})]})})}function Af(){return i.jsxs("svg",{className:ct.icono_carpeta,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.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)"}),i.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"}),i.jsx("circle",{cx:"35",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),i.jsx("circle",{cx:"55",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),i.jsx("path",{d:"M42 65H48",stroke:"var(--color-primary-text)",strokeWidth:"1.5",strokeLinecap:"round"}),i.jsx("circle",{cx:"78",cy:"78",r:"14",fill:"var(--brand-primary)"}),i.jsx("path",{d:"M78 71V85M71 78H85",stroke:"var(--base)",strokeWidth:"2.5",strokeLinecap:"round"})]})}const Lf=({fila:e,controls:t})=>(t?.length??0)>0?i.jsx("div",{className:Me.contenedor_acciones_card,children:t?.filter(o=>!o.visible||o.visible(e.original)).map(o=>"contenido"in o?i.jsxs("span",{className:`${Me.boton_personalizado} ${Me.boton_acciones} ${Me.boton_card}`,onClick:r=>{const s=r.currentTarget.querySelector("button");s&&!s.contains(r.target)&&s.click()},children:[o.contenido(e.original)," ",o.nombre]},o.id):i.jsxs("button",{id:o.id,type:"button",title:o.nombre,onClick:()=>o.evento(e.original),className:`${Me.boton_acciones} ${Me.boton_card}`,children:[o.icono," ",o.nombre]},o.id))}):null,Df=({columnasRestantes:e,table:t})=>e.length===0?null:i.jsx("div",{className:Me.contenedor_contenido_cards,children:e.map(n=>i.jsxs("div",{className:Me.contenedor_fila_card,children:[i.jsx("div",{className:Me.card_fila_label,children:xt(n.column.id,t)}),i.jsx("div",{className:Me.card_fila_valor,children:yt(n.column.columnDef.cell,n.getContext())})]},n.id))}),zf=({fila:e,table:t,idPrimeraColumna:n,idSegundaColumna:o})=>{const r=pa(e,n),s=pa(e,o);return i.jsxs("div",{className:Me.contenedor_encabezado_card,children:[i.jsx("div",{className:Me.contenedor_columna_card,children:n&&r&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:Me.card_label,children:xt(n,t)}),i.jsx("div",{className:Me.card_valor,children:ga(e,n)})]})}),i.jsx("div",{className:Me.contenedor_columna_card,children:o&&s&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:Me.card_label,children:xt(o,t)}),i.jsx("div",{className:Me.card_segundo_valor,children:ga(e,o)})]})})]})};function Pf(){const e=Jn();if(!e)return null;const{state:t}=e,{table:n,controls:o,primerasColumnas:r,loading:s,columns:a}=t;if(!n)return null;const l=a&&r?Ca(a,r[0]):void 0,d=a&&r?Ca(a,r[1]):void 0,u=xa(l),_=xa(d);if(s)return i.jsx(Nf,{filas:3,cantidadControles:o?.length??0,table:n,idPrimeraColumna:u,idSegundaColumna:_});const p=n.getRowModel().rows;return p.length===0?i.jsx("article",{className:Me.contenedor_card,children:i.jsx($a,{})}):i.jsx("section",{className:Me.contenedor_tabla_cards,children:p.map(f=>{const c=Ju(f,u,_);return i.jsxs("article",{id:`tabla-card-${f.id}`,className:Me.contenedor_card,children:[i.jsx(zf,{fila:f,table:n,idPrimeraColumna:u,idSegundaColumna:_}),i.jsx(Df,{columnasRestantes:c,table:n}),i.jsx(Lf,{fila:f,controls:o})]},f.id)})})}const Sa={filas:"_filas_1q6db_1",columnas:"_columnas_1q6db_20"},Tf=({columnas:e,filas:t})=>i.jsx(i.Fragment,{children:Array.from({length:t}).map((n,o)=>i.jsx("tr",{className:Sa.filas,children:Array.from({length:e}).map((r,s)=>i.jsx("td",{className:Sa.columnas},`sk-cell-${o}-${s}`))},`sk-row-${o}`))}),dt={contenedor:"_contenedor_57n60_1",barra:"_barra_57n60_11",info:"_info_57n60_25",btn_cerrar:"_btn_cerrar_57n60_32",contador:"_contador_57n60_40",separador:"_separador_57n60_49",acciones:"_acciones_57n60_56"};function Of({totalSeleccionadas:e,acciones:t,filasSeleccionadas:n,onLimpiarSeleccion:o}){const[r,s]=m.useState(0),[a,l]=m.useState([]),[d,u]=m.useState([]),_=e>0,p=m.useRef(null);return ya(o,_),m.useEffect(()=>{_&&(s(e),l(t),u(n))},[e,t,n,_]),i.jsx(Kt,{mostrar:_,tipo:"escalar",className:dt.contenedor,children:i.jsxs("div",{ref:p,className:dt.barra,children:[i.jsxs("div",{className:dt.info,children:[i.jsx(nn,{isIconOnly:!0,variant:"light",color:"default",size:"md",radius:"md",onClick:o,"aria-label":"Limpiar selección",className:dt.btn_cerrar,children:i.jsx(_f,{})}),i.jsxs("p",{className:dt.contador,children:[r," filas seleccionadas"]})]}),i.jsx("div",{className:dt.separador}),i.jsx("div",{className:dt.acciones,children:a.map(f=>i.jsx("div",{children:f.componente(d)},f.id))})]})})}function Vf({dir:e}){return e?e==="asc"?i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:qe.icono_orden,"aria-hidden":"true",children:i.jsx("path",{fill:"currentColor",d:"m12 10.8l-4.6 4.6L6 14l6-6l6 6l-1.4 1.4z"})}):i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:qe.icono_orden,"aria-hidden":"true",children:i.jsx("path",{fill:"currentColor",d:"M12 13.2L7.4 8.6L6 10l6 6l6-6l-1.4-1.4z"})}):null}function qf(){const e=Jn();if(!e)return null;const{state:t}=e,{table:n,loading:o,selectorFilas:r=[]}=t;if(!n)return null;const s=n.getHeaderGroups(),a=n.getRowModel().rows,l=n.getVisibleLeafColumns().length,d=n.getState().pagination.pageIndex,u=n.getSelectedRowModel().rows,_=u.length,p=()=>{n.resetRowSelection()};return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:qe.wrapper_scroll_tabla,children:i.jsxs("table",{className:qe.contenedor_tabla,children:[i.jsx("thead",{children:s.map(f=>i.jsx("tr",{children:f.headers.map(c=>{const h=c.column.columnDef.meta?.style;return i.jsx("th",{id:`tabla-col-${c.id}`,className:qe.encabezados,style:h,"data-columna":c.id,children:c.id==="select"?i.jsx("div",{children:yt(c.column.columnDef.header,c.getContext())}):i.jsxs("div",{className:qe.contenido_encabezado,style:{justifyContent:h?.textAlign==="center"?"center":h?.textAlign==="right"?"flex-end":void 0},onClick:c.column.getToggleSortingHandler(),children:[yt(c.column.columnDef.header,c.getContext()),i.jsx(Vf,{dir:c.column.getIsSorted()})]})},c.id)})},f.id))}),i.jsx("tbody",{className:qe.contenedor_datos,children:o?i.jsx(Tf,{columnas:l,filas:10}):a.length===0?i.jsx("tr",{children:i.jsx("td",{colSpan:l,style:{backgroundColor:"var(--base)"},children:i.jsx($a,{})})}):a.map(f=>i.jsx("tr",{id:`tabla-fila-${f.id}`,className:`${qe.datos} ${f.getIsSelected()?qe.seleccionada:""}`,"data-fila-index":f.index,children:f.getVisibleCells().map(c=>{const h=c.column.columnDef.meta?.style;return i.jsx("td",{className:qe.columna,style:h,"data-columna":c.column.id,children:yt(c.column.columnDef.cell,c.getContext())},c.id)})},f.id))},d)]})}),r?.length>0?i.jsx(Of,{totalSeleccionadas:_,acciones:r,filasSeleccionadas:u.map(f=>f.original),onLimpiarSeleccion:p}):null]})}const jf=830;function Bf({id:e}){const t=m.useRef(null),[n,o]=m.useState(!1);return m.useEffect(()=>{const r=t.current;if(!r)return;const s=new ResizeObserver(([a])=>{o(a.contentRect.width<=jf)});return s.observe(r),()=>s.disconnect()},[]),i.jsxs("main",{className:qe.contenedor,id:e,ref:t,children:[i.jsx(Ef,{}),i.jsxs("div",{className:qe.tabla_card,children:[n?i.jsx(Pf,{}):i.jsx(qf,{}),i.jsx(Mf,{})]})]})}function Hf({id:e,...t}){return i.jsx(Ru,{...t,children:i.jsx(Bf,{id:e})})}const Pe={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"},ka=m.createContext(void 0),Gf=()=>m.useContext(ka),Zr=m.memo(m.forwardRef(({value:e,label:t,description:n,size:o="md",color:r="primary",customColor:s,variant:a="default",isDisabled:l=!1,isReadOnly:d=!1,isInvalid:u=!1,isRequired:_=!1,children:p,className:f="",onChange:c,...h},g)=>{const v=Gf(),w=m.useId(),y=h.id||w,x=v?.name||h.name,k=v?.size||o,L=v?.color||r,A=v?.customColor||s,M=v?.variant||a,T=v?.isDisabled||l,P=v?.isReadOnly||d,I=v?.isInvalid||u,q=v?.isRequired||_,V=v?.value!==void 0?v.value===e:void 0,S=p||t,b=N=>{T||P||(v?.onChange&&v.onChange(e),c&&c(N))},$=[Pe.contenedor_radio,Pe[`tam_${k}`],!A&&Pe[`color_${L}`],Pe[`variante_${M}`],T&&Pe.deshabilitado,P&&Pe.solo_lectura,I&&Pe.invalido,V&&Pe.seleccionado,f].filter(Boolean).join(" "),D=A?{"--radio-custom-color":A}:void 0;return i.jsx("div",{className:$,style:D,children:i.jsxs("label",{className:Pe.envoltorio_radio,htmlFor:y,children:[i.jsxs("div",{className:Pe.radio,children:[i.jsx("input",{ref:g,type:"radio",id:y,name:x,value:e,checked:V,disabled:T,readOnly:P,required:q,"aria-invalid":I,className:Pe.input,onChange:b,...h}),i.jsx("div",{className:Pe.circulo_radio,children:i.jsx("div",{className:Pe.punto_radio})})]})," ",S&&i.jsxs("div",{className:Pe.contenedor_label,children:[i.jsxs("span",{className:Pe.texto_label,children:[S,_&&!v&&i.jsx("span",{className:Pe.marca_requerido,children:" *"})]}),n&&i.jsx("span",{className:Pe.texto_descripcion,children:n})]})]})})}));Zr.displayName="Radio";const Ia=({name:e,value:t,defaultValue:n,onChange:o,orientation:r="horizontal",label:s,description:a,isDisabled:l=!1,isReadOnly:d=!1,isRequired:u=!1,isInvalid:_=!1,errorMessage:p,size:f,color:c,customColor:h,variant:g,justifyContent:v="flex-start",children:w,className:y="",options:x,optionValueKey:k,optionLabelKey:L,optionDisabledKey:A,optionDescriptionKey:M})=>{const[T,P]=m.useState(String(n??"")),I=t!==void 0?String(t):T,V={name:e,value:I,onChange:$=>{l||d||(t===void 0&&P($),o&&o($))},size:f,color:c,customColor:h,variant:g,isDisabled:l,isReadOnly:d,isInvalid:_,isRequired:u},S=[Pe.grupo_radio,Pe[`orientacion_${r}`],_&&Pe.grupo_invalido,l&&Pe.grupo_deshabilitado,d&&Pe.grupo_solo_lectura,y].filter(Boolean).join(" "),b=v==="center"?"center":v==="flex-end"?"right":"left";return i.jsx(ka.Provider,{value:V,children:i.jsxs("div",{className:S,role:"radiogroup","aria-required":u,"aria-invalid":_,style:{textAlign:b},children:[s&&i.jsxs("div",{className:Pe.encabezado_grupo,children:[i.jsxs("label",{className:Pe.label_grupo,children:[s,u&&i.jsx("span",{className:Pe.marca_requerido,children:" *"})]}),a&&i.jsx("span",{className:Pe.descripcion_grupo,children:a})]}),i.jsx("div",{className:Pe.contenedor_radios,style:{justifyContent:v},children:x&&x.length>0?x.map(($,D)=>{let N,C,z=!1,O;if(typeof $=="object"&&$!==null){const W=k??"value",G=L??"label",F=A??"isDisabled",j=M??"description",B=$[W],te=$[G];N=String(B!==void 0?B:D),C=te;const Z=$[F];z=typeof Z=="boolean"?Z:!1;const R=$[j];O=typeof R=="string"?R:void 0}else N=String($),C=$;return i.jsx(Zr,{value:N,isDisabled:z,description:O,children:C},N)}):w}),_&&p&&i.jsx("span",{className:Pe.mensaje_error,children:p})]})})};Ia.displayName="RadioGroup";const pn={backdrop:"_backdrop_1l1et_1",visible:"_visible_1l1et_41",drawer:"_drawer_1l1et_61",posicion_right:"_posicion_right_1l1et_127",drawer_detras:"_drawer_detras_1l1et_159",posicion_left:"_posicion_left_1l1et_167",posicion_top:"_posicion_top_1l1et_207",posicion_bottom:"_posicion_bottom_1l1et_247",radio_none:"_radio_none_1l1et_287",radio_sm:"_radio_sm_1l1et_295",radio_md:"_radio_md_1l1et_315",radio_lg:"_radio_lg_1l1et_335",radio_xl:"_radio_xl_1l1et_355",tamano_auto:"_tamano_auto_1l1et_455",tamano_sm:"_tamano_sm_1l1et_479",tamano_md:"_tamano_md_1l1et_489",tamano_lg:"_tamano_lg_1l1et_499",tamano_xl:"_tamano_xl_1l1et_509",tamano_full:"_tamano_full_1l1et_519",encabezado:"_encabezado_1l1et_579",titulo:"_titulo_1l1et_599",boton_cerrar:"_boton_cerrar_1l1et_619",contenido:"_contenido_1l1et_673",pie:"_pie_1l1et_685",loading_overlay:"_loading_overlay_1l1et_705",spinner:"_spinner_1l1et_729",spin:"_spin_1l1et_729",loading_text:"_loading_text_1l1et_759",resize_handle:"_resize_handle_1l1et_771"},Ea=m.forwardRef(({isOpen:e,onClose:t,position:n="right",size:o="md",title:r,showCloseButton:s=!0,closeOnBackdropClick:a=!0,closeOnEscape:l=!0,preventScroll:d=!0,header:u,footer:_,children:p,className:f="",contentClassName:c="",isLoading:h=!1,loadingMessage:g="Cargando...",onOpen:v,backdropVariant:w="normal",borderRadius:y,resizable:x=!1,zIndex:k,getContainer:L},A)=>{const M=m.useRef(null),[T,P]=m.useState(!1),I=m.useCallback(()=>{T||(P(!0),setTimeout(()=>{t?.(),P(!1)},500))},[t,T]);m.useEffect(()=>{e&&P(!1)},[e]),m.useEffect(()=>{if(e){if(v?.(),d){const F=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",F>0&&(document.body.style.paddingRight=`${F}px`)}if(l){const F=j=>{j.key==="Escape"&&I()};return document.addEventListener("keydown",F),()=>{document.removeEventListener("keydown",F),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 q=F=>{a&&F.target===M.current&&I()},V=y?pn[`radio_${y}`]:void 0,S=e&&!T,b=[pn.drawer,pn[`posicion_${n}`],pn[`tamano_${o}`],S&&pn.visible,V,f].filter(Boolean).join(" "),$=[pn.contenido,c].filter(Boolean).join(" "),D=[pn.backdrop,S&&pn.visible].filter(Boolean).join(" "),N=k||500,C={transparente:{opacity:0},sutil:{opacity:.2},normal:{opacity:.4},intermedio:{opacity:.6},intenso:{opacity:.8}},z=C[w]||C.normal,{opacity:O}=z,W={background:`rgb(0 0 0 / ${O})`,zIndex:N,...L&&{position:"absolute"}},G=i.jsx("div",{className:D,ref:M,onClick:q,style:W,children:i.jsxs("div",{ref:A,className:b,role:"dialog","aria-modal":"true","aria-labelledby":"drawer-title",children:[(r||u)&&i.jsx("div",{className:pn.encabezado,children:u||i.jsxs(i.Fragment,{children:[i.jsx("h2",{id:"drawer-title",className:pn.titulo,children:r}),s&&i.jsx("button",{type:"button",className:pn.boton_cerrar,onClick:I,"aria-label":"Cerrar",children:i.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:i.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}),i.jsx("div",{className:$,children:p}),_&&i.jsx("div",{className:pn.pie,children:_}),h&&i.jsxs("div",{className:pn.loading_overlay,children:[i.jsx("div",{className:pn.spinner}),i.jsx("span",{className:pn.loading_text,children:g})]}),x&&i.jsx("div",{className:pn.resize_handle})]})});if(L){const F=typeof L=="function"?L():L;if(F&&F instanceof HTMLElement)return St.createPortal(G,F)}return G});Ea.displayName="Drawer";const Re={backdrop:"_backdrop_11a2t_1",visible:"_visible_11a2t_41",centrado:"_centrado_11a2t_65",modal:"_modal_11a2t_73",tamano_sm:"_tamano_sm_11a2t_145",tamano_md:"_tamano_md_11a2t_153",tamano_lg:"_tamano_lg_11a2t_161",tamano_xl:"_tamano_xl_11a2t_169",tamano_formulario:"_tamano_formulario_11a2t_177",tamano_full:"_tamano_full_11a2t_185",tamano_auto:"_tamano_auto_11a2t_193",encabezado:"_encabezado_11a2t_203",contenedor_titulo_completo:"_contenedor_titulo_completo_11a2t_221",contenedor_titulo_icono:"_contenedor_titulo_icono_11a2t_231",icono_titulo:"_icono_titulo_11a2t_243",titulo:"_titulo_11a2t_257",contenido:"_contenido_11a2t_277",pie:"_pie_11a2t_289",loading_overlay:"_loading_overlay_11a2t_309",spinner:"_spinner_11a2t_335",spinner_dot:"_spinner_dot_11a2t_351",loadingBounce:"_loadingBounce_11a2t_1",loading_text:"_loading_text_11a2t_419",radius_none:"_radius_none_11a2t_433",radius_sm:"_radius_sm_11a2t_441",radius_md:"_radius_md_11a2t_449",radius_lg:"_radius_lg_11a2t_457",radius_full:"_radius_full_11a2t_465",close_button:"_close_button_11a2t_473"},Jr=m.forwardRef(({isOpen:e,onClose:t,size:n="md",title:o,titleIcon:r,closeOnBackdropClick:s=!1,closeOnEscape:a=!0,preventScroll:l=!0,isCentered:d=!0,header:u,footer:_,children:p,className:f="",contentClassName:c="",isLoading:h=!1,loadingMessage:g="Cargando...",backdropVariant:v="normal",showIconTitle:w=!1,onOpen:y,radius:x="lg",showCloseButton:k=!1},L)=>{const A=m.useRef(null),M=m.useCallback(()=>{h||t?.()},[t,h]);m.useEffect(()=>{if(e){if(y?.(),l){const $=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",$>0&&(document.body.style.paddingRight=`${$}px`)}if(a){const $=D=>{D.key==="Escape"&&M()};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,M,a,l,y]);const T=$=>{s&&$.target===A.current&&M()},P=[Re.backdrop,d&&Re.centrado,e&&Re.visible].filter(Boolean).join(" "),I=[Re.modal,Re[`tamano_${n}`],Re[`radius_${x}`],f].filter(Boolean).join(" "),q=[Re.contenido,c].filter(Boolean).join(" "),V={transparente:{opacity:0},sutil:{opacity:.3},normal:{opacity:.5},intermedio:{opacity:.7},intenso:{opacity:.9}},{opacity:S}=V[v]||V.normal,b={background:`rgb(0 0 0 / ${S})`};return i.jsx("div",{className:P,ref:A,onClick:T,style:b,children:i.jsxs("div",{ref:L,className:I,role:"dialog","aria-modal":"true","aria-labelledby":"modal-title",children:[(o||u||k)&&i.jsxs("div",{className:Re.encabezado,children:[i.jsx("div",{className:Re.contenedor_titulo_completo,children:u||i.jsx(i.Fragment,{children:i.jsxs("div",{className:Re.contenedor_titulo_icono,children:[w&&r!==void 0&&(typeof r=="string"?i.jsx("span",{className:Re.icono_titulo,children:r}):r),w&&r===void 0&&i.jsx("span",{className:Re.icono_titulo,children:"📄"}),i.jsx("h2",{id:"modal-title",className:Re.titulo,children:o})]})})}),k&&i.jsx("button",{type:"button",className:Re.close_button,onClick:M,"aria-label":"Cerrar",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),i.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),i.jsx("div",{className:q,children:p}),_&&i.jsx("div",{className:Re.pie,children:_}),h&&i.jsxs("div",{className:Re.loading_overlay,children:[i.jsxs("div",{className:Re.spinner,children:[i.jsx("span",{className:Re.spinner_dot}),i.jsx("span",{className:Re.spinner_dot}),i.jsx("span",{className:Re.spinner_dot})]}),i.jsx("span",{className:Re.loading_text,children:g})]})]})})});Jr.displayName="Modal";function Wf(e){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 256",...e,children:[i.jsx("path",{fill:"currentColor",d:"M232 128c0 12.5-17.8 22-22.7 33.7s1.4 30.6-7.8 39.8s-28.5 3.1-39.8 7.8S140.5 232 128 232s-22-17.8-33.7-22.7s-30.6 1.4-39.8-7.8s-3.1-28.5-7.8-39.8S24 140.5 24 128s17.8-22 22.7-33.7s-1.4-30.6 7.8-39.8s28.5-3.1 39.8-7.8S115.5 24 128 24s22 17.8 33.7 22.7s30.6-1.4 39.8 7.8s3.1 28.5 7.8 39.8S232 115.5 232 128Z",opacity:".2"}),i.jsx("path",{fill:"currentColor",d:"M225.9 102.8c-3.8-3.9-7.7-8-9.2-11.5s-1.4-8.7-1.5-14c-.1-9.7-.3-20.8-8-28.5s-18.8-7.9-28.5-8c-5.3-.1-10.7-.2-14-1.5s-7.6-5.4-11.5-9.2C146.3 23.5 138.4 16 128 16s-18.3 7.5-25.2 14.1c-3.9 3.8-8 7.7-11.5 9.2s-8.7 1.4-14 1.5c-9.7.1-20.8.3-28.5 8s-7.9 18.8-8 28.5c-.1 5.3-.2 10.7-1.5 14s-5.4 7.6-9.2 11.5C23.5 109.7 16 117.6 16 128s7.5 18.3 14.1 25.2c3.8 3.9 7.7 8 9.2 11.5s1.4 8.7 1.5 14c.1 9.7.3 20.8 8 28.5s18.8 7.9 28.5 8c5.3.1 10.7.2 14 1.5s7.6 5.4 11.5 9.2c6.9 6.6 14.8 14.1 25.2 14.1s18.3-7.5 25.2-14.1c3.9-3.8 8-7.7 11.5-9.2s8.7-1.4 14-1.5c9.7-.1 20.8-.3 28.5-8s7.9-18.8 8-28.5c.1-5.3.2-10.7 1.5-14s5.4-7.6 9.2-11.5c6.6-6.9 14.1-14.8 14.1-25.2s-7.5-18.3-14.1-25.2ZM120 136V80a8 8 0 0 1 16 0v56a8 8 0 0 1-16 0Zm20 36a12 12 0 1 1-12-12a12 12 0 0 1 12 12Z"})]})}function Kf(e){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:[i.jsx("path",{fill:"currentColor",d:"M3 6.386c0-.484.345-.877.771-.877h2.665c.529-.016.996-.399 1.176-.965l.03-.1l.115-.391c.07-.24.131-.45.217-.637c.338-.739.964-1.252 1.687-1.383c.184-.033.378-.033.6-.033h3.478c.223 0 .417 0 .6.033c.723.131 1.35.644 1.687 1.383c.086.187.147.396.218.637l.114.391l.03.1c.18.566.74.95 1.27.965h2.57c.427 0 .772.393.772.877s-.345.877-.771.877H3.77c-.425 0-.77-.393-.77-.877"}),i.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.425 11.482c.413-.044.78.273.821.707l.5 5.263c.041.433-.26.82-.671.864c-.412.043-.78-.273-.821-.707l-.5-5.263c-.041-.434.26-.821.671-.864m5.15 0c.412.043.713.43.671.864l-.5 5.263c-.04.434-.408.75-.82.707c-.413-.044-.713-.43-.672-.864l.5-5.264c.041-.433.409-.75.82-.707",clipRule:"evenodd"}),i.jsx("path",{fill:"currentColor",d:"M11.596 22h.808c2.783 0 4.174 0 5.08-.886c.904-.886.996-2.339 1.181-5.245l.267-4.188c.1-1.577.15-2.366-.303-2.865c-.454-.5-1.22-.5-2.753-.5H8.124c-1.533 0-2.3 0-2.753.5s-.404 1.288-.303 2.865l.267 4.188c.185 2.906.277 4.36 1.182 5.245c.905.886 2.296.886 5.079.886",opacity:".5"})]})}function Uf(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",...e,children:i.jsxs("g",{fill:"currentColor",children:[i.jsxs("g",{opacity:".2",children:[i.jsx("path",{d:"M14.696 12.282a1 1 0 1 1-1.392 1.436a2 2 0 0 0-.102-.09a2.4 2.4 0 0 0-.623-.348c-.453-.18-1-.28-1.579-.28c-.914 0-1.733.251-2.202.629q-.056.044-.102.089a1 1 0 1 1-1.392-1.436q.114-.11.24-.212C8.395 11.387 9.656 11 11 11c.827 0 1.624.146 2.316.42c.43.17.815.389 1.14.65q.126.102.24.212"}),i.jsx("path",{d:"M17.213 9.689a1 1 0 1 1-1.426 1.402a4 4 0 0 0-.312-.285a5.5 5.5 0 0 0-.767-.521a6 6 0 0 0-.932-.425a7 7 0 0 0-1.057-.298a8 8 0 0 0-1.137-.153a9 9 0 0 0-1.74.058a8 8 0 0 0-1.102.227a7 7 0 0 0-1 .364a6 6 0 0 0-.854.477a5 5 0 0 0-.361.27a4 4 0 0 0-.312.286A1 1 0 1 1 4.787 9.69q.218-.22.462-.424q.243-.201.512-.384a7.5 7.5 0 0 1 1.15-.643a9 9 0 0 1 1.286-.469a10 10 0 0 1 1.379-.284A10.5 10.5 0 0 1 11 7.39a11 11 0 0 1 1.424.095a10 10 0 0 1 1.38.284a9 9 0 0 1 1.285.469a8 8 0 0 1 1.15.643q.27.183.512.384q.244.204.462.424"}),i.jsx("path",{d:"M19.245 7.222a1 1 0 0 1-1.49 1.333a6 6 0 0 0-.456-.459a7 7 0 0 0-.52-.43a8.4 8.4 0 0 0-1.215-.747a9 9 0 0 0-1.408-.563a10 10 0 0 0-1.542-.35A11 11 0 0 0 11 5.89a11 11 0 0 0-1.614.117a10.5 10.5 0 0 0-1.542.35a9.6 9.6 0 0 0-1.407.564a8 8 0 0 0-.635.353a8 8 0 0 0-.58.393a7 7 0 0 0-.52.43a6 6 0 0 0-.457.46a1 1 0 0 1-1.49-1.334q.28-.314.6-.604q.316-.29.668-.553q.351-.262.732-.496a10.4 10.4 0 0 1 1.62-.813a11.6 11.6 0 0 1 1.785-.554a12.5 12.5 0 0 1 1.883-.279a13.2 13.2 0 0 1 2.864.105a12.5 12.5 0 0 1 1.842.418a11.6 11.6 0 0 1 1.71.686a10.4 10.4 0 0 1 1.518.933q.351.264.669.553t.6.604M13 16.25a2 2 0 1 1-4 0a2 2 0 0 1 4 0"})]}),i.jsx("path",{d:"M13.348 11.641a.5.5 0 0 1-.696.718a2 2 0 0 0-.136-.12a3 3 0 0 0-.753-.424A4.8 4.8 0 0 0 10 11.5c-1.022 0-1.951.285-2.516.739q-.073.06-.136.12a.5.5 0 0 1-.696-.718q.097-.094.206-.182c.754-.606 1.905-.959 3.142-.959c.765 0 1.5.134 2.132.385c.385.153.726.346 1.01.574q.109.089.206.182m2.508-2.601a.5.5 0 1 1-.712.7a5 5 0 0 0-.35-.32a5 5 0 0 0-.399-.298a6.6 6.6 0 0 0-1.449-.731a8 8 0 0 0-1.126-.319a9 9 0 0 0-1.205-.162a9.3 9.3 0 0 0-1.839.061a9 9 0 0 0-1.172.242a8 8 0 0 0-1.071.39a6.6 6.6 0 0 0-.928.519q-.21.143-.399.298q-.186.155-.35.32a.5.5 0 0 1-.712-.7q.198-.202.424-.39q.225-.186.474-.355a7 7 0 0 1 1.076-.602a8 8 0 0 1 1.215-.443a9 9 0 0 1 1.31-.27A10 10 0 0 1 10 6.89a10 10 0 0 1 1.357.09a10 10 0 0 1 1.31.27a9 9 0 0 1 1.215.443a7.6 7.6 0 0 1 1.076.602q.249.17.474.355q.226.188.424.39"}),i.jsx("path",{d:"M17.873 6.555a.5.5 0 1 1-.746.667a7 7 0 0 0-.492-.496a8 8 0 0 0-.557-.46a9 9 0 0 0-1.29-.794a9.5 9.5 0 0 0-1.484-.594a10.6 10.6 0 0 0-1.617-.366A11.4 11.4 0 0 0 10 4.389a12 12 0 0 0-1.687.123a11 11 0 0 0-1.617.366a10 10 0 0 0-1.483.595a9 9 0 0 0-.673.374a8 8 0 0 0-.618.42q-.294.22-.557.46q-.263.239-.492.495a.5.5 0 1 1-.746-.667q.264-.294.564-.568t.632-.521q.332-.249.694-.471a10 10 0 0 1 1.545-.775a11 11 0 0 1 1.709-.53a12 12 0 0 1 1.808-.268a12.7 12.7 0 0 1 2.754.1a12 12 0 0 1 1.767.401a11 11 0 0 1 1.635.656q.387.194.749.416q.36.222.693.47q.333.249.632.522q.3.274.564.568M11.75 15.25a1.75 1.75 0 1 1-3.5 0a1.75 1.75 0 0 1 3.5 0"}),i.jsx("path",{d:"M1.15 1.878a.514.514 0 0 1 .728-.727l16.971 16.971a.514.514 0 0 1-.727.727z"})]})})}function Xf(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M13.435 2.075a3.33 3.33 0 0 0-2.87 0c-.394.189-.755.497-1.26.928l-.079.066a2.56 2.56 0 0 1-1.58.655l-.102.008c-.662.053-1.135.09-1.547.236a3.33 3.33 0 0 0-2.03 2.029c-.145.412-.182.885-.235 1.547l-.008.102a2.56 2.56 0 0 1-.655 1.58l-.066.078c-.431.506-.74.867-.928 1.261a3.33 3.33 0 0 0 0 2.87c.189.394.497.755.928 1.26l.066.079c.41.48.604.939.655 1.58l.008.102c.053.662.09 1.135.236 1.547a3.33 3.33 0 0 0 2.029 2.03c.412.145.885.182 1.547.235l.102.008c.629.05 1.09.238 1.58.655l.078.066c.506.431.867.74 1.261.928a3.33 3.33 0 0 0 2.87 0c.394-.189.755-.497 1.26-.928l.079-.066c.48-.41.939-.604 1.58-.655l.102-.008c.662-.053 1.135-.09 1.547-.236a3.33 3.33 0 0 0 2.03-2.029c.145-.412.182-.885.235-1.547l.008-.102c.05-.629.238-1.09.655-1.58l.066-.079c.431-.505.74-.866.928-1.26a3.33 3.33 0 0 0 0-2.87c-.189-.394-.497-.755-.928-1.26l-.066-.079a2.56 2.56 0 0 1-.655-1.58l-.008-.102c-.053-.662-.09-1.135-.236-1.547a3.33 3.33 0 0 0-2.029-2.03c-.412-.145-.885-.182-1.547-.235l-.102-.008a2.56 2.56 0 0 1-1.58-.655l-.079-.066c-.505-.431-.866-.74-1.26-.928M12 7.25a.75.75 0 0 1 .75.75v.5a.75.75 0 0 1-1.5 0V8a.75.75 0 0 1 .75-.75M10.75 16a.75.75 0 0 1 .5-.707v-3.586a.75.75 0 0 1 .25-1.457h.5a.75.75 0 0 1 .75.75v4.293a.75.75 0 0 1-.25 1.457h-1a.75.75 0 0 1-.75-.75"})})}function Yf(e){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 48 48",...e,children:[i.jsx("defs",{children:i.jsx("mask",{id:"SVG4IxzvcIZ",children:i.jsxs("g",{fill:"none",stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4",children:[i.jsx("path",{fill:"#555",d:"m24 4l5.253 3.832l6.503-.012l1.997 6.188l5.268 3.812L41 24l2.021 6.18l-5.268 3.812l-1.997 6.188l-6.503-.012L24 44l-5.253-3.832l-6.503.012l-1.997-6.188l-5.268-3.812L7 24l-2.021-6.18l5.268-3.812l1.997-6.188l6.503.012z"}),i.jsx("path",{d:"m17 24l5 5l10-10"})]})})}),i.jsx("path",{fill:"currentColor",d:"M0 0h48v48H0z",mask:"url(#SVG4IxzvcIZ)"})]})}const tn={contenido:"_contenido_1yq4k_1",modal_radio:"_modal_radio_1yq4k_6",cuerpo:"_cuerpo_1yq4k_10",icono_wrapper:"_icono_wrapper_1yq4k_19",icono:"_icono_1yq4k_19",icono_personalizado:"_icono_personalizado_1yq4k_28",titulo:"_titulo_1yq4k_44",mensaje:"_mensaje_1yq4k_53",descripcion:"_descripcion_1yq4k_62",grupo_botones:"_grupo_botones_1yq4k_70",solo_confirmar:"_solo_confirmar_1yq4k_78",boton_modal:"_boton_modal_1yq4k_82",advertencia:"_advertencia_1yq4k_86",eliminar:"_eliminar_1yq4k_90",exito:"_exito_1yq4k_94",info:"_info_1yq4k_98",sin_conexion:"_sin_conexion_1yq4k_102",personalizado:"_personalizado_1yq4k_106"},Zf={advertencia:Wf,eliminar:Kf,exito:Yf,info:Xf,"sin-conexion":Uf},Jf={advertencia:tn.advertencia,eliminar:tn.eliminar,exito:tn.exito,info:tn.info,"sin-conexion":tn.sin_conexion,personalizado:tn.personalizado},Ma=m.forwardRef(({isOpen:e,tipo:t="advertencia",titulo:n,mensaje:o="¿Estás seguro de continuar?",descripcion:r,textoConfirmar:s="Confirmar",textoCancelar:a="Cancelar",onConfirmar:l,onCancelar:d,size:u="sm",closeOnBackdropClick:_=!1,icono:p,loadingConfirmar:f=!1,timeout:c,colorTipo:h,colorBotonConfirmar:g},v)=>{const w=Zf[t],y=t==="exito";m.useEffect(()=>{if(!e||!c)return;const k=setTimeout(l,c);return()=>clearTimeout(k)},[e,c,l]);const x=h?{"--color-tipo":h}:void 0;return i.jsx(Jr,{ref:v,isOpen:e,onClose:d,size:u,isCentered:!0,closeOnBackdropClick:_,closeOnEscape:!y,className:tn.modal_radio,contentClassName:tn.contenido,children:i.jsxs("div",{className:`${tn.cuerpo} ${Jf[t]}`,style:x,children:[i.jsx("div",{className:tn.icono_wrapper,children:p?i.jsx("span",{className:tn.icono_personalizado,"aria-hidden":"true",children:p}):w&&i.jsx(w,{className:tn.icono,"aria-hidden":"true"})}),n&&i.jsx("h2",{className:tn.titulo,children:n}),i.jsx("p",{className:tn.mensaje,children:o}),r&&i.jsx("p",{className:tn.descripcion,children:r}),i.jsxs("div",{className:`${tn.grupo_botones}${y?` ${tn.solo_confirmar}`:""}`,children:[!y&&i.jsx(nn,{variant:"outline",size:"sm",fullWidth:!0,className:tn.boton_modal,onClick:d,children:a}),i.jsx(nn,{size:"sm",fullWidth:!0,isLoading:f,className:tn.boton_modal,style:{"--btn-color":g??"var(--color-tipo)"},onClick:l,children:s})]})]})})});Ma.displayName="ModalAviso";const kn={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 Qf({modals:e,onClose:t}){const[n,o]=m.useState([]),[r,s]=m.useState(!1);m.useEffect(()=>{const f=()=>{s(window.innerWidth<=768)};return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]);const a=f=>{o(c=>[...c,f]),setTimeout(()=>{t(f),o(c=>c.filter(h=>h!==f))},300)};if(e.length===0)return null;const l=e.length-1,d=500,u=24,_=e.length*d+(e.length-1)*u,p=e.length>1?_/2-d/2-l*(d+u):0;return i.jsx("div",{className:kn.overlay,children:i.jsx("div",{className:kn.container,style:r?void 0:{transform:`translateX(${p}px)`},children:e.map((f,c)=>{const h=n.includes(f.id),g=c===e.length-1,v=[kn.modal,h&&kn.modal_closing,!g&&kn.modal_detras].filter(Boolean).join(" ");return i.jsxs("div",{className:v,children:[i.jsxs("div",{className:kn.header,children:[i.jsx("button",{type:"button",className:kn.button_back,onClick:()=>a(f.id),"aria-label":"Volver",children:i.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:i.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),i.jsxs("div",{className:kn.title_container,children:[f.titleIcon&&i.jsx("span",{className:kn.title_icon,children:f.titleIcon}),i.jsx("h2",{className:kn.title,children:f.title})]})]}),i.jsx("div",{className:kn.content,children:f.content}),f.footer&&i.jsx("div",{className:kn.footer,children:f.footer})]},f.id)})})})}const Qr=m.createContext(null),Rr=()=>{const e=m.useContext(Qr);if(!e)throw new Error("useDropdownContext debe usarse dentro de DropdownMenu o ContextMenu");return e},Bt=e=>e.type==="separator"||e.type==="label"?!1:"children"in e&&Array.isArray(e.children)&&e.children.length>0,Na=e=>e.type==="checkbox",Fa=e=>e.type==="radio",Aa=e=>e.type==="separator",La=e=>e.type==="label",Se={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"},Rf=()=>i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:i.jsx("polyline",{points:"20 6 9 17 4 12"})}),e_=()=>i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:i.jsx("polyline",{points:"9 18 15 12 9 6"})}),n_=({marcado:e})=>i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[i.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),e&&i.jsx("circle",{cx:"12",cy:"12",r:"5",fill:"currentColor"})]}),ei=m.forwardRef(({item:e,index:t,activeIndex:n,getItemProps:o},r)=>{const s=Rr();if(Aa(e))return i.jsx("div",{className:X(Se.separator,s.classNames?.separator),role:"separator"});if(La(e))return i.jsx("div",{className:X(Se.label,s.classNames?.label),role:"presentation","data-testid":"dropdown-label",children:e.label});const a=t===n,l=Na(e),d=Fa(e),u=M=>{"isDisabled"in e&&e.isDisabled||(l?e.onCheckedChange?.(!e.isChecked):d&&s.onRadioChange?.(e.value),"onSelect"in e&&e.onSelect&&e.onSelect(M),s.closeOnSelect&&!Bt(e)&&s.cerrarMenu())},_=M=>{u(M)},p=M=>{"isDisabled"in e&&e.isDisabled||(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),u(M))},f=l?e.isChecked:!1,c=d?s.radioValue===e.value:!1,h="label"in e?e.label:void 0,g="description"in e?e.description:void 0,v="shortcut"in e?e.shortcut:void 0,w="startIcon"in e?e.startIcon:void 0,y="endIcon"in e?e.endIcon:void 0,x="isDisabled"in e?e.isDisabled:!1,k="isLoading"in e?e.isLoading:!1,L="isDanger"in e?e.isDanger:!1,A="className"in e?e.className:void 0;return i.jsxs("div",{ref:r,role:l?"menuitemcheckbox":d?"menuitemradio":"menuitem","aria-checked":l?f:d?c:void 0,"aria-disabled":x||k,tabIndex:a?0:-1,className:X(Se.item,Se[`size_${s.size}`],a&&Se.active,x&&Se.disabled,k&&Se.loading,L&&Se.danger,Bt(e)&&Se.has_submenu,A,s.classNames?.item),onClick:_,onKeyDown:p,...o(),children:[k?i.jsx("span",{className:Se.indicator,children:i.jsx("span",{className:Se.spinner_item})}):(l||d)&&i.jsxs("span",{className:Se.indicator,children:[l&&f&&i.jsx(Rf,{}),d&&i.jsx(n_,{marcado:c})]}),!k&&w&&i.jsx("span",{className:Se.start_icon,children:w}),i.jsxs("span",{className:Se.content,children:[i.jsx("span",{className:Se.label_text,children:h}),g&&i.jsx("span",{className:Se.description,children:g})]}),v&&i.jsx("kbd",{className:Se.shortcut,children:v}),y&&i.jsx("span",{className:Se.end_icon,children:y}),Bt(e)&&i.jsx("span",{className:Se.submenu_arrow,children:i.jsx(e_,{})})]})});ei.displayName="MenuItem";const t_=()=>i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:i.jsx("polyline",{points:"9 18 15 12 9 6"})}),To=({items:e,activeIndex:t,getItemProps:n,listRef:o})=>i.jsx(i.Fragment,{children:(e??[]).map((r,s)=>Bt(r)?i.jsx(ni,{ref:a=>{o.current[s]=a},item:r,index:s,activeIndex:t,getItemProps:n},r.id):i.jsx(ei,{ref:a=>{o.current[s]=a},item:r,index:s,activeIndex:t,getItemProps:n},r.id))});To.displayName="MenuList";const ni=m.forwardRef(({item:e,index:t,activeIndex:n,getItemProps:o},r)=>{const s=Rr(),[a,l]=m.useState(!1),d=it(),u=vs(),_=m.useRef([]),[p,f]=m.useState(null),{refs:c,floatingStyles:h,context:g,isPositioned:v}=$o({nodeId:u,open:a,onOpenChange:l,placement:"right-start",middleware:[_o({mainAxis:4,alignmentAxis:-4}),po(),go({padding:8})],whileElementsMounted:co}),{isMounted:w,styles:y}=Mo(g,{duration:s.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:s.disableAnimation?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}}),x=vr(g,{enabled:!e.isDisabled,delay:{open:75},handleClose:js({blockPointerEvents:!0})}),k=Eo(g,{role:"menu"}),L=xo(g,{bubbles:!0}),A=kr(g,{listRef:_,activeIndex:p,onNavigate:f,nested:!0}),{getReferenceProps:M,getFloatingProps:T,getItemProps:P}=So([x,k,L,A]);m.useEffect(()=>{if(!d)return;const V=()=>l(!1);return d.events.on("click",V),()=>{d.events.off("click",V)}},[d]);const I=t===n,q=cs([c.setReference,r]);return i.jsxs(bs,{id:u,children:[i.jsxs("div",{ref:q,role:"menuitem","aria-haspopup":"menu","aria-expanded":a,"aria-disabled":e.isDisabled,tabIndex:I?0:-1,className:X(Se.item,Se[`size_${s.size}`],I&&Se.active,e.isDisabled&&Se.disabled,e.isDanger&&Se.danger,Se.has_submenu,a&&Se.submenu_open,e.className,s.classNames?.item),...M(o()),children:[e.startIcon&&i.jsx("span",{className:Se.start_icon,children:e.startIcon}),i.jsxs("span",{className:Se.content,children:[i.jsx("span",{className:Se.label_text,children:e.label}),e.description&&i.jsx("span",{className:Se.description,children:e.description})]}),e.shortcut&&i.jsx("kbd",{className:Se.shortcut,children:e.shortcut}),i.jsx("span",{className:Se.submenu_arrow,children:i.jsx(t_,{})})]}),w&&i.jsx(Co,{root:s.portalContainer,children:i.jsx(Cr,{context:g,modal:!1,initialFocus:-1,returnFocus:!1,children:i.jsx("div",{ref:c.setFloating,style:{...h,pointerEvents:"none",zIndex:s.zIndex??"var(--z-dropdown)"},children:i.jsx("div",{className:X(Se.menu,Se[`variant_${s.variant}`],s.classNames?.menu),style:{...y,pointerEvents:"auto",visibility:v||!a?"visible":"hidden"},...T(),children:i.jsx(To,{items:e.children,activeIndex:p,getItemProps:P,listRef:_})})})})})]})});ni.displayName="Submenu";const Da=m.forwardRef(({children:e,items:t,triggerAction:n="click",placement:o="bottom-start",variant:r="default",size:s="md",isDisabled:a=!1,offset:l=4,minWidth:d="180px",matchTriggerWidth:u=!1,disableAnimation:_=!1,closeOnClickOutside:p=!0,closeOnEscape:f=!0,closeOnSelect:c=!0,className:h,classNames:g,style:v,onOpen:w,onClose:y,onOpenChange:x,onContextMenu:k,isOpen:L,zIndex:A,portalContainer:M,radioValue:T,onRadioChange:P},I)=>{const[q,V]=m.useState(!1),[S,b]=m.useState(null),[$,D]=m.useState(0),N=m.useRef([]),C=m.useRef([]),z=vs(),O=L!==void 0,W=O?L:q,G=m.useCallback(H=>{a&&H||(O||V(H),x?.(H),H?w?.():y?.())},[a,O,x,w,y]);m.useEffect(()=>{C.current=(t??[]).filter(H=>H.type!=="separator"&&H.type!=="label").map(H=>"label"in H&&typeof H.label=="string"?H.label:"")},[t]);const{refs:F,floatingStyles:j,context:B,isPositioned:te}=$o({nodeId:z,open:W,onOpenChange:G,placement:o,strategy:"fixed",middleware:[_o(l),po({fallbackAxisSideDirection:"start",padding:8}),go({padding:8}),u?ls({apply({rects:H,elements:K}){Object.assign(K.floating.style,{minWidth:`${H.reference.width}px`})}}):void 0].filter(Boolean),whileElementsMounted:co}),Z=Ls(B,{enabled:!a&&(n==="click"||n==="both"),toggle:!0}),R=vr(B,{enabled:!a&&n==="hover",delay:{open:150,close:150},handleClose:js()}),ge=xo(B,{enabled:f||p,escapeKey:f,outsidePress:p}),fe=Eo(B,{role:"menu"}),Ce=kr(B,{listRef:N,activeIndex:S,onNavigate:b,loop:!0}),Q=Os(B,{listRef:C,activeIndex:S,onMatch:b,enabled:W}),{getReferenceProps:se,getFloatingProps:re,getItemProps:be}=So([Z,R,ge,fe,Ce,Q]),{isMounted:le,styles:ne}=Mo(B,{duration:_?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:_?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}});m.useImperativeHandle(I,()=>({open:()=>G(!0),close:()=>G(!1),toggle:()=>G(!W),isOpen:W}),[G,W]);const ue=m.useMemo(()=>({radioValue:T,onRadioChange:P,cerrarMenu:()=>G(!1),closeOnSelect:c,size:s,variant:r,disableAnimation:_,classNames:g,portalContainer:M,zIndex:A}),[T,P,G,c,s,r,_,g,M,A]),we=m.isValidElement(e)?e:null,oe=cs([F.setReference,we?.ref||null]);if(!we)return e!=null&&console.error("DropdownMenu: children debe ser un elemento React válido"),null;const ye=n==="contextmenu"||n==="both"?{onContextMenu:H=>{H.preventDefault();const K={x:H.clientX,y:H.clientY};k?.(H,K),G(!1),D(ie=>ie+1),requestAnimationFrame(()=>{F.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:K.x,y:K.y,top:K.y,left:K.x,right:K.x,bottom:K.y}}}),G(!0)})},onClick:()=>{W&&n==="contextmenu"&&G(!1)}}:{},U=m.cloneElement(e,se({...e.props,...ye,ref:oe,"aria-haspopup":"menu","aria-expanded":W}));return i.jsx(Qr.Provider,{value:ue,children:i.jsxs(bs,{id:z,children:[U,le&&i.jsx(Co,{root:M,children:i.jsx(Cr,{context:B,modal:!1,initialFocus:-1,returnFocus:!0,children:i.jsx("div",{ref:F.setFloating,style:{...j,zIndex:A??"var(--z-dropdown)",outline:"none",pointerEvents:"none"},children:i.jsx("div",{role:"menu","aria-orientation":"vertical",className:X(Se.menu,Se[`variant_${r}`],Se[`size_${s}`],h,g?.menu),style:{...ne,minWidth:d,...v,transform:[ne.transform,v?.transform].filter(Boolean).join(" "),pointerEvents:"auto",visibility:te||!W?"visible":"hidden"},...re(),children:i.jsx(To,{items:t,activeIndex:S,getItemProps:be,listRef:N})},$)})})})]})})});Da.displayName="DropdownMenuInner";const Oo=m.forwardRef((e,t)=>i.jsx(cd,{children:i.jsx(Da,{...e,ref:t})}));Oo.displayName="DropdownMenu";const za=m.forwardRef(({isEnabled:e=!0,children:t,...n},o)=>i.jsx(Oo,{...n,ref:o,triggerAction:"contextmenu",isDisabled:!e||n.isDisabled,children:t}));za.displayName="ContextMenu";const Hn={group_button:"_group_button_wgdis_1",full_width:"_full_width_wgdis_17",main_button:"_main_button_wgdis_27",dropdown_trigger:"_dropdown_trigger_wgdis_35",first_item:"_first_item_wgdis_45",last_item:"_last_item_wgdis_55",variant_bordered:"_variant_bordered_wgdis_65",variant_ghost:"_variant_ghost_wgdis_67",variant_faded:"_variant_faded_wgdis_69",disabled:"_disabled_wgdis_93",loading:"_loading_wgdis_93",chevron:"_chevron_wgdis_111",chevron_open:"_chevron_open_wgdis_123"},o_=({label:e,onClick:t,items:n,variant:o="solid",color:r="primary",size:s="md",radius:a="md",isLoading:l=!1,isDisabled:d=!1,dropdownIcon:u,className:_,fullWidth:p=!1,...f})=>{const[c,h]=m.useState(!1),g=X(Hn.group_button,Hn[`variant_${o}`],p&&Hn.full_width,_),v=()=>i.jsx("div",{className:X(Hn.chevron,c&&Hn.chevron_open),children:i.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:i.jsx("path",{d:"m6 9 6 6 6-6"})})});return i.jsxs("div",{className:g,children:[i.jsx(nn,{variant:o,color:r,size:s,radius:a,isLoading:l,isDisabled:d,onClick:t,className:X(Hn.main_button,Hn.first_item),...f,children:e}),n&&i.jsx(Oo,{items:n,triggerAction:"click",onOpenChange:h,placement:"bottom-end",isDisabled:d||l,variant:"default",size:s,matchTriggerWidth:!1,children:i.jsx(nn,{variant:o,color:r,size:s,radius:a,isDisabled:d||l,isIconOnly:!0,className:X(Hn.dropdown_trigger,Hn.last_item),"aria-label":"M�s acciones",children:u||v()})})]})},Pa=()=>i.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),Ta=()=>i.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:i.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"})}),Oa=()=>i.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:i.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"})}),Va=()=>i.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("polyline",{points:"15 18 9 12 15 6"})}),qa=()=>i.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("polyline",{points:"9 18 15 12 9 6"})}),on={overlay:"_overlay_1jwfa_1",backdrop:"_backdrop_1jwfa_25",visible:"_visible_1jwfa_51",layout:"_layout_1jwfa_75",columna_acciones:"_columna_acciones_1jwfa_143",boton_flotante:"_boton_flotante_1jwfa_163",boton_primario:"_boton_primario_1jwfa_237",boton_peligro:"_boton_peligro_1jwfa_247",panel:"_panel_1jwfa_265",encabezado:"_encabezado_1jwfa_293",titulo:"_titulo_1jwfa_311",contenido:"_contenido_1jwfa_327",paginacion:"_paginacion_1jwfa_341",texto_paginacion:"_texto_paginacion_1jwfa_367"},r_={transparente:{background:"transparent"},sutil:{background:"rgb(0 0 0 / 20%)"},normal:{background:"rgb(0 0 0 / 40%)"},intenso:{background:"rgb(0 0 0 / 60%)"}},i_=({isOpen:e,onClose:t,onApply:n,onClear:o,title:r="Filtros",backdropVariant:s="sutil",closeOnBackdropClick:a=!0,allowBackdropInteraction:l=!1,getContainer:d,children:u})=>{const[_,p]=m.useState(!1),[f,c]=m.useState(0),h=l||s==="transparente",g=m.useCallback(()=>{_||(p(!0),setTimeout(()=>{t(),p(!1),c(0)},500))},[t,_]);m.useEffect(()=>{e&&p(!1)},[e]),m.useEffect(()=>{if(!e)return;const I=q=>q.key==="Escape"&&g();return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[e,g]);const v=m.useCallback(I=>{a&&I.target===I.currentTarget&&g()},[a,g]),w=m.useCallback(I=>{document.activeElement?.blur(),I?.()},[]),{pages:y,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:L}=r_[s],A={background:L,pointerEvents:h?"none":"auto"},M=d?{position:"absolute"}:{},T=d?{position:"relative"}:{},P=i.jsxs("div",{className:on.overlay,role:"dialog","aria-modal":"true",style:M,children:[i.jsx("div",{className:`${on.backdrop} ${e&&!_?on.visible:""}`,style:A,onClick:v}),i.jsxs("div",{className:`${on.layout} ${e&&!_?on.visible:""}`,style:T,children:[i.jsxs("aside",{className:on.columna_acciones,children:[i.jsx(lt,{content:"Cerrar",placement:"left",children:i.jsx("button",{className:on.boton_flotante,onClick:()=>w(g),"aria-label":"Cerrar panel",children:i.jsx(Pa,{})})}),i.jsx(lt,{content:"Aplicar filtros",placement:"left",children:i.jsx("button",{className:`${on.boton_flotante} ${on.boton_primario}`,onClick:()=>w(n),children:i.jsx(Ta,{})})}),i.jsx(lt,{content:"Limpiar filtros",placement:"left",children:i.jsx("button",{className:`${on.boton_flotante} ${on.boton_peligro}`,onClick:()=>w(o),children:i.jsx(Oa,{})})}),k&&i.jsxs("div",{className:on.paginacion,children:[i.jsx("button",{className:on.boton_flotante,style:{width:36,height:36},onClick:()=>c(I=>Math.max(0,I-1)),disabled:f===0,"aria-label":"Página anterior",children:i.jsx(Va,{})}),i.jsxs("span",{className:on.texto_paginacion,children:[f+1," / ",x]}),i.jsx("button",{className:on.boton_flotante,style:{width:36,height:36},onClick:()=>c(I=>Math.min(x-1,I+1)),disabled:f===x-1,"aria-label":"Página siguiente",children:i.jsx(qa,{})})]})]}),i.jsxs("main",{className:on.panel,children:[i.jsx("header",{className:on.encabezado,children:i.jsx("h2",{className:on.titulo,children:r})}),i.jsx("div",{className:on.contenido,children:i.jsx("div",{style:{animation:"fadeIn 0.3s ease"},children:y[f]},f)})]})]})]});if(d){const I=typeof d=="function"?d():d;if(I&&I instanceof HTMLElement)return St.createPortal(P,I)}return P};Y.Badge=li,Y.BadgeVoz=Yo,Y.Boton=nn,Y.Checkbox=Ct,Y.CheckboxGroup=_a,Y.ContextMenu=za,Y.Drawer=Ea,Y.DropdownContext=Qr,Y.DropdownMenu=Oo,Y.GrabacionIcono=wi,Y.GroupButton=o_,Y.IconoCerrar=Pa,Y.IconoDerecha=qa,Y.IconoFiltroAplicar=Ta,Y.IconoFiltroLimpiar=Oa,Y.IconoIzquierda=Va,Y.InputDate=bi,Y.InputNumeric=vi,Y.InputText=_i,Y.MenuItem=ei,Y.MenuList=To,Y.MicrofonoIcono=Uo,Y.Modal=Jr,Y.ModalAviso=Ma,Y.ModalStack=Qf,Y.PanelFiltros=i_,Y.Radio=Zr,Y.RadioGroup=Ia,Y.Select=Rs,Y.Signature=fi,Y.SonidoIcono=Xo,Y.Submenu=ni,Y.TablaDatos=Hf,Y.TextArea=Ci,Y.Toggle=Go,Y.Tooltip=lt,Y.Transicion=Kt,Y.esCheckbox=Na,Y.esLabel=La,Y.esRadio=Fa,Y.esSeparador=Aa,Y.fechaEnRango=bl,Y.formatearFecha=Ko,Y.formatearNumero=kt,Y.generarOpcionesAleatorias=Yd,Y.generarUsuariosPrueba=Zd,Y.obtenerFechaHoy=vl,Y.parsearNumero=gi,Y.procesarValidacion=pi,Y.redondearDecimales=hi,Y.restringirRango=Wo,Y.tieneHijos=Bt,Y.useCheckboxGroupContext=fa,Y.useDropdownContext=Rr,Y.useReconocimientoVoz=yi,Y.useTablaContext=ef,Y.useTablaContextSafe=Jn,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})}));
28
+ */function Nn(e,n){return e?k_(e)?M.createElement(e,n):e:null}function k_(e){return N_(e)||typeof e=="function"||E_(e)}function N_(e){return typeof e=="function"&&(()=>{const n=Object.getPrototypeOf(e);return n.prototype&&n.prototype.isReactComponent})()}function E_(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function M_(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=M.useState(()=>({current:m_(n)})),[o,a]=M.useState(()=>t.current.initialState);return t.current.setOptions(i=>({...i,...e,state:{...o,...e.state},onStateChange:s=>{a(s),e.onStateChange==null||e.onStateChange(s)}})),t.current}const Pe={checkbox_container:"_checkbox_container_3c4gu_1",checkbox_wrapper:"_checkbox_wrapper_3c4gu_13",label_text:"_label_text_3c4gu_33",hint_text:"_hint_text_3c4gu_51",checkbox:"_checkbox_3c4gu_1",input:"_input_3c4gu_99",checkbox_svg:"_checkbox_svg_3c4gu_153",custom_icon:"_custom_icon_3c4gu_195",checked:"_checked_3c4gu_225",indeterminate:"_indeterminate_3c4gu_227",radius_none:"_radius_none_3c4gu_235",radius_sm:"_radius_sm_3c4gu_243",radius_md:"_radius_md_3c4gu_251",radius_lg:"_radius_lg_3c4gu_259",radius_full:"_radius_full_3c4gu_267",sm:"_sm_3c4gu_275",lg:"_lg_3c4gu_301",secondary:"_secondary_3c4gu_327",success:"_success_3c4gu_335",warning:"_warning_3c4gu_343",danger:"_danger_3c4gu_351",solid:"_solid_3c4gu_377",outline:"_outline_3c4gu_391",disabled:"_disabled_3c4gu_439",readonly:"_readonly_3c4gu_509",no_animation:"_no_animation_3c4gu_589",line_through:"_line_through_3c4gu_607",lineThrough:"_lineThrough_3c4gu_1",checkbox_group:"_checkbox_group_3c4gu_651",label:"_label_3c4gu_33",marca_requerido:"_marca_requerido_3c4gu_679",description:"_description_3c4gu_687",checkboxes:"_checkboxes_3c4gu_701",vertical:"_vertical_3c4gu_711",horizontal:"_horizontal_3c4gu_719",grid:"_grid_3c4gu_727",error_message:"_error_message_3c4gu_737",invalid:"_invalid_3c4gu_749"},Ns=h.createContext(null),Es=()=>h.useContext(Ns),En=h.forwardRef((e,n)=>{const{children:t,label:o,hint:a,isSelected:i,defaultChecked:s,isIndeterminate:l=!1,isDisabled:c=!1,isReadOnly:u=!1,isRequired:_=!1,lineThrough:g=!1,onlyIcon:f=!1,disableAnimation:d=!1,customCheckIcon:m,size:p="md",color:v="primary",customColor:y,radius:w="md",variant:C="solid",className:k="",classNames:z={},onChange:A,value:N,name:P,id:O,...E}=e,T=Es(),V=h.useId(),S=O||V,b=h.useRef(null),x=i!==void 0,[F,I]=h.useState(s??!1),$=!!T,D=$&&N?T.value.includes(N):!1,B=$?D:x?i:F,X=!!T?.maxSelectionReached&&!B,U=c||T?.isDisabled||X,L=u||T?.isReadOnly,j=T?!1:_,W=P||T?.name;h.useEffect(()=>{const ae=b.current||(n&&typeof n=="object"?n.current:null);ae&&(ae.indeterminate=l??!1)},[l,n]);const ie=ae=>{if(U||L)return;const me=ae.target.checked;$&&N?T.onChange(N):(x||I(me),A?.(me))},re=o||t;return r.jsxs("div",{className:ne(Pe.checkbox_container,{[Pe.disabled]:U,[Pe.readonly]:L},z.base,k),children:[r.jsxs("label",{className:ne(Pe.checkbox_wrapper,Pe[p],!y&&Pe[v],Pe[C],Pe[`radius_${w}`],{[Pe.checked]:B,[Pe.indeterminate]:l,[Pe.disabled]:U,[Pe.readonly]:L,[Pe.line_through]:g&&B,[Pe.no_animation]:d}),style:y?{"--checkbox-custom-color":y}:void 0,children:[r.jsxs("span",{className:Pe.checkbox,children:[r.jsx("input",{ref:ae=>{b.current=ae,typeof n=="function"?n(ae):n&&(n.current=ae)},id:S,type:"checkbox",className:Pe.input,checked:B,onChange:ie,disabled:U,readOnly:L,required:j,value:N,name:W,...E}),m?r.jsx("span",{className:Pe.custom_icon,children:m}):r.jsx("svg",{className:Pe.checkbox_svg,viewBox:"0 0 22 22","aria-hidden":"true",children:r.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"})})]}),!f&&re&&r.jsx("span",{className:ne(Pe.label_text,z.label),children:re})]}),a&&r.jsx("span",{className:ne(Pe.hint_text,z.label),children:a})]})});En.displayName="Checkbox";const Ms=({label:e,children:n,description:t,errorMessage:o,isInvalid:a=!1,orientation:i="vertical",className:s,value:l,defaultValue:c=[],onChange:u,isDisabled:_=!1,isReadOnly:g=!1,isRequired:f=!1,minSelection:d,maxSelection:m,requiredMessage:p,name:v,options:y,optionValueKey:w,optionLabelKey:C,optionDisabledKey:k,optionDescriptionKey:z,columns:A})=>{const N=l!==void 0,[P,O]=h.useState(c),E=N?l:P,T=h.useRef(null),V=f?d??1:d??0,S=m!==void 0&&E.length>=m;h.useEffect(()=>{if(!T.current||V===0)return;V-E.length<=0?T.current.setCustomValidity(""):T.current.setCustomValidity(p??(V===1?"Selecciona al menos una opción":`Selecciona al menos ${V} opciones`))},[E,V,p]);const b=F=>{if(_||g)return;const I=E.includes(F);if(!I&&S)return;const $=I?E.filter(D=>D!==F):[...E,F];N||O($),u?.($)},x=r.jsx("input",{ref:T,type:"checkbox",required:!0,checked:E.length>=V,onChange:()=>{},"aria-hidden":"true",tabIndex:-1,style:{height:"1px",left:0,opacity:0,pointerEvents:"none",position:"absolute",top:"100%",width:"1px"}});return r.jsxs("div",{className:ne(Pe.checkbox_group,Pe[i],{[Pe.invalid]:a,[Pe.disabled]:_,[Pe.readonly]:g},s),role:"group","aria-required":f||V>0,"aria-invalid":a,children:[V>0&&!e&&x,e&&r.jsxs("div",{className:Pe.label,style:{position:"relative"},children:[e,(f||V>0)&&r.jsx("span",{className:Pe.marca_requerido,children:" *"}),V>0&&x]}),t&&r.jsx("div",{className:Pe.description,children:t}),r.jsx(Ns.Provider,{value:{value:E,onChange:b,isDisabled:_,isReadOnly:g,isRequired:f,name:v,maxSelectionReached:S},children:r.jsx("div",{className:ne(Pe.checkboxes,!A&&Pe[i],A&&Pe.grid),style:A?{gridTemplateColumns:typeof A=="number"?`repeat(${A}, 1fr)`:A}:void 0,children:y&&y.length>0?y.map((F,I)=>{let $,D,B=!1,X;if(typeof F=="object"&&F!==null){const U=w??"value",L=C??"label",j=k??"isDisabled",W=z??"description",ie=F[U];$=String(ie!==void 0?ie:I),D=F[L];const re=F[j];B=typeof re=="boolean"?re:!1;const ae=F[W];X=typeof ae=="string"?ae:void 0}else $=String(F),D=F;return r.jsx(En,{value:$,isDisabled:B,hint:X,children:D},$)}):n})}),o&&a&&r.jsx("div",{className:Pe.error_message,children:o})]})};Ms.displayName="CheckboxGroup";const We={contenedor:"_contenedor_16k0y_1",contenedor_superior:"_contenedor_superior_16k0y_17",input_con_icono:"_input_con_icono_16k0y_35",icono_busqueda:"_icono_busqueda_16k0y_49",input_busqueda:"_input_busqueda_16k0y_75",contenedor_acciones_botones:"_contenedor_acciones_botones_16k0y_147",contenedor_acciones:"_contenedor_acciones_16k0y_147",columna:"_columna_16k0y_183",encabezados:"_encabezados_16k0y_203",contenido_encabezado:"_contenido_encabezado_16k0y_229",icono_orden:"_icono_orden_16k0y_243",boton_basico:"_boton_basico_16k0y_323",texto_filtros:"_texto_filtros_16k0y_347",menu_configuraciones:"_menu_configuraciones_16k0y_379",tabla_card:"_tabla_card_16k0y_427",wrapper_scroll_tabla:"_wrapper_scroll_tabla_16k0y_439",contenedor_tabla:"_contenedor_tabla_16k0y_453",contenedor_datos:"_contenedor_datos_16k0y_467",datos:"_datos_16k0y_501",seleccionada:"_seleccionada_16k0y_549",boton_acciones:"_boton_acciones_16k0y_609"};function I_(e,n,t=3){const o=Math.floor(t/2);let a=e-o;a<1&&(a=1),a+t-1>n&&(a=Math.max(1,n-t+1));const i=Math.min(t,n);return Array.from({length:i},(s,l)=>a+l)}function F_(e,n){return n===0?0:e>=n?n-1:e<0?0:e}function Mn(e,n){const t=new Map;n.getFlatHeaders().forEach(s=>t.set(s.column.id,s));const o=t.get(e);if(o)return Nn(o.column.columnDef.header,o.getContext());const a=n.getAllLeafColumns().find(s=>s.id===e),i=a?.columnDef.header;return typeof i=="string"||typeof i=="number"?i:a?.id??e}function Is(e,n){const t=e.getVisibleCells().find(o=>o.column.id===n);return t?Nn(t.column.columnDef.cell,t.getContext()):null}function Fs(e,n){return n?e.getVisibleCells().map(o=>o.column.id).includes(n):!1}function z_(e,n,t){return e.getVisibleCells().filter(o=>o.column.id!=="actions"&&o.column.id!==n&&o.column.id!==t)}function L_(e,n){if(n===0)return"";if(n===1)return la(e[0].nombre.toLowerCase());if(n===2)return`${la(e[0].nombre.toLowerCase())}, ${e[1].nombre.toLowerCase()}`;const t=e.slice(0,2).map(a=>a.nombre.toLowerCase()),o=n-2;return`${la(t.join(", "))} y ${o>1?`otros ${o}`:"otro"} más`}function la(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function zs(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}const Ls=h.createContext(null),ca=Ls;function Zo(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t+=1)if(e[t]!==n[t])return!1;return!0}function A_({children:e,data:n,columns:t,controls:o,loading:a,primerasColumnas:i,tamanioPaginaInicial:s=10,filtros:l,descargarExcel:c,actualizarTabla:u,selectorFilas:_=[],sinDatosProps:g,maxColumnasVisibles:f=10,...d}){const[m,p]=h.useState(""),v=xu(m,200),y=Hr("only screen and (max-width: 830px)"),[w,C]=h.useState({pageIndex:0,pageSize:s}),[k,z]=h.useState({}),A=h.useMemo(()=>{const L={},j=new Set;t.forEach(ie=>{const re="accessorKey"in ie?String(ie.accessorKey):ie.id;re&&ie.meta?.isHidden&&(L[re]=!1,j.add(re))});let W=0;return t.forEach(ie=>{const re="accessorKey"in ie?String(ie.accessorKey):ie.id;!re||j.has(re)||(W<f?W++:L[re]=!1)}),L},[t,f]),[N,P]=h.useState(()=>A);h.useEffect(()=>{P(A)},[A]);const O=h.useMemo(()=>{const L=[];return _.length>0&&!y&&L.push({id:"select",header:({table:j})=>r.jsx(En,{color:"secondary",isSelected:j.getIsAllPageRowsSelected(),isIndeterminate:j.getIsSomePageRowsSelected()&&!j.getIsAllPageRowsSelected(),onChange:W=>j.toggleAllPageRowsSelected(!!W)}),cell:({row:j})=>r.jsx(En,{color:"primary",isSelected:j.getIsSelected(),isDisabled:!j.getCanSelect(),onChange:W=>j.toggleSelected(W)}),enableSorting:!1,enableHiding:!1}),L.push(...t),o?.length&&L.push({id:"actions",header:"Acciones",cell:j=>r.jsx("div",{className:We.contenedor_acciones,children:o.filter(W=>!W.visible||W.visible(j.row.original)).map(W=>"contenido"in W?r.jsx(_n,{content:W.nombre,variant:"default",size:"sm",placement:"top",children:r.jsx("span",{children:W.contenido(j.row.original,We.boton_acciones)})},W.id):r.jsx(_n,{content:W.nombre,variant:"default",size:"sm",placement:"top",children:r.jsx(Ze,{id:W.id,size:"sm",radius:"md",variant:"light",isIconOnly:!0,onClick:()=>W.evento(j.row.original),className:We.boton_acciones,children:W.icono})},W.id))}),enableSorting:!1,enableHiding:!1}),L},[t,o,_.length,y]),E=h.useMemo(()=>{const L=O.map(W=>"accessorKey"in W&&W.accessorKey!=null?String(W.accessorKey):"id"in W&&W.id!=null?String(W.id):"").filter(Boolean),j=L.indexOf("actions");return j>-1&&j<L.length-1&&(L.splice(j,1),L.push("actions")),L},[O]),[T,V]=h.useState(()=>E);h.useEffect(()=>{V(L=>Zo(L,E)?L:E)},[E]);const S=h.useCallback((L,j,W)=>{if(!W)return!0;const ie=zs(String(W)),re=L.getValue(j);return re==null?!1:zs(String(re)).includes(ie)},[]),b=M_({data:n,columns:O,state:{pagination:w,globalFilter:v,columnOrder:T,rowSelection:k,columnVisibility:N},onColumnVisibilityChange:P,globalFilterFn:S,enableRowSelection:_.length>0,onRowSelectionChange:z,onPaginationChange:C,onColumnOrderChange:L=>{V(j=>{const W=typeof L=="function"?L(j):L;return Zo(j,W)?j:W})},getCoreRowModel:v_(),getSortedRowModel:S_(),getFilteredRowModel:x_(),getPaginationRowModel:$_(),autoResetPageIndex:!1}),x=b.getPageCount();h.useEffect(()=>{const L=F_(w.pageIndex,x);L!==w.pageIndex&&C(j=>({...j,pageIndex:L}))},[w.pageIndex,x]);const F=h.useRef(v);h.useEffect(()=>{F.current!==v&&C(j=>j.pageIndex===0?j:{...j,pageIndex:0}),F.current=v},[v]);const I=h.useMemo(()=>b.getAllLeafColumns().filter(L=>L.id!=="actions"&&L.id!=="select"&&L.getCanHide?.()),[b]),$=h.useCallback(L=>{const W=t.find(ie=>"accessorKey"in ie?String(ie.accessorKey)===L:String(ie.id)===L)?.header;return typeof W=="string"||typeof W=="number"?String(W):L},[t]),D=h.useCallback(()=>{P(A),b.setPageSize(s),b.setPageIndex(0),b.resetRowSelection(),V(L=>Zo(L,E)?L:E)},[b,s,E,A]),B=h.useCallback(L=>{const j=Math.max(1,Math.min(200,L));b.setPageSize(j),b.setPageIndex(0)},[b]),X=h.useCallback(L=>{V(j=>{const W=typeof L=="function"?L(j):L;return Zo(j,W)?j:W})},[]),U=h.useMemo(()=>({state:{ordenColumnas:T,table:b,columns:O,controls:o,loading:a,primerasColumnas:[String(i[0]),String(i[1])],inputBusqueda:m,setInputBusqueda:p,filtros:l,descargarExcel:c,actualizarTabla:u,selectorFilas:_,sinDatosProps:g,maxColumnasVisibles:f,...d},todasLasColumnas:I,etiquetaColumna:$,restaurarConfiguracion:D,cambiarPageSize:B,cambiarOrdenColumnas:X}),[T,b,O,o,a,m,l,i,c,u,_,g,f,d,I,$,D,B,X]);return r.jsx(Ls.Provider,{value:U,children:e})}function D_(){const e=h.useContext(ca);if(!e)throw new Error("useTablaContext debe usarse dentro de TablaDatosProvider");return e}function tn(){const e=h.useContext(ca);return e||null}const Gt={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 As(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:r.jsx("path",{fill:"currentColor",d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6l6 6z"})})}function Ds(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:r.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 P_(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:r.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 T_(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:r.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 O_(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",...e,children:r.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M10.97 20.344L9 21v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4h16v2.172a2 2 0 0 1-.586 1.414L15 12v1.5m3.42 2.11a2.1 2.1 0 0 1 2.97 2.97L18 22h-3v-3z"})})}function V_(e){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",...e,children:[r.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"}),r.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 B_(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:r.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[r.jsx("circle",{cx:"12",cy:"12",r:"3"}),r.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 j_(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:r.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 q_(e){return r.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",...e,children:[r.jsx("circle",{cx:"5.5",cy:"4",r:"1.2",fill:"currentColor"}),r.jsx("circle",{cx:"5.5",cy:"8",r:"1.2",fill:"currentColor"}),r.jsx("circle",{cx:"5.5",cy:"12",r:"1.2",fill:"currentColor"}),r.jsx("circle",{cx:"10.5",cy:"4",r:"1.2",fill:"currentColor",opacity:".35"}),r.jsx("circle",{cx:"10.5",cy:"8",r:"1.2",fill:"currentColor",opacity:".35"}),r.jsx("circle",{cx:"10.5",cy:"12",r:"1.2",fill:"currentColor",opacity:".35"})]})}function H_(e){return r.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[r.jsx("rect",{x:"3",y:"3",width:"4",height:"14",rx:"1",fill:"currentColor"}),r.jsx("rect",{x:"8",y:"3",width:"9",height:"14",rx:"1",fill:"currentColor",opacity:".3"})]})}function W_(e){return r.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[r.jsx("rect",{x:"3",y:"3",width:"14",height:"4",rx:"1",fill:"currentColor"}),r.jsx("rect",{x:"3",y:"8",width:"14",height:"9",rx:"1",fill:"currentColor",opacity:".3"})]})}function G_(e){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",...e,children:[r.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor",opacity:".2"}),r.jsx("path",{fill:"currentColor",d:"M13 7a1 1 0 1 0-2 0v4H7a1 1 0 1 0 0 2h4v4a1 1 0 1 0 2 0v-4h4a1 1 0 1 0 0-2h-4V7Z"})]})}function Z_(e){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:[r.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor",opacity:".2"}),r.jsx("path",{fill:"currentColor",d:"M7 12a1 1 0 0 1 1-1h8a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1Z"})]})}function U_(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:r.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"})})}function K_(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",...e,children:r.jsxs("g",{fill:"none",children:[r.jsx("path",{fill:"currentColor",d:"M7.378 11.63h-.75zm0 .926l-.562.497a.75.75 0 0 0 1.08.044zm2.141-1.015a.75.75 0 0 0-1.038-1.082zm-2.958-1.038a.75.75 0 1 0-1.122.994zm8.37-1.494a.75.75 0 1 0 1.102-1.018zM12.045 6.25c-2.986 0-5.416 2.403-5.416 5.38h1.5c0-2.137 1.747-3.88 3.916-3.88zm-5.416 5.38v.926h1.5v-.926zm1.269 1.467l1.622-1.556l-1.038-1.082l-1.622 1.555zm.042-1.039l-1.378-1.555l-1.122.994l1.377 1.556zm8.094-4.067a5.42 5.42 0 0 0-3.99-1.741v1.5a3.92 3.92 0 0 1 2.889 1.26zm.585 3.453l.56-.498a.75.75 0 0 0-1.08-.043zm-2.139 1.014a.75.75 0 1 0 1.04 1.082zm2.96 1.04a.75.75 0 0 0 1.12-.997zm-8.393 1.507a.75.75 0 0 0-1.094 1.026zm2.888 2.745c2.993 0 5.434-2.4 5.434-5.38h-1.5c0 2.135-1.753 3.88-3.934 3.88zm5.434-5.38v-.926h-1.5v.926zm-1.27-1.467l-1.619 1.555l1.04 1.082l1.618-1.555zm-.04 1.04l1.38 1.554l1.122-.996l-1.381-1.555zM7.952 16.03a5.45 5.45 0 0 0 3.982 1.719v-1.5c-1.143 0-2.17-.48-2.888-1.245z"}),r.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",opacity:".5"})]})})}function X_(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",role:"button",...e,children:r.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"})})}function Y_(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",role:"button",...e,children:r.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"})})}const J_=({titulo:e,onBack:n})=>r.jsxs("header",{className:Gt.header,children:[r.jsx(Ze,{isIconOnly:!0,variant:"light",onClick:n,"aria-label":"Regresar",children:r.jsx(As,{})}),r.jsx("h3",{className:Gt.titulo,children:e})]}),nn={contenedor:"_contenedor_1leqv_1",lista:"_lista_1leqv_13",item:"_item_1leqv_45",item_dragging:"_item_dragging_1leqv_75",item_deshabilitado:"_item_deshabilitado_1leqv_85",icono_drag:"_icono_drag_1leqv_95",nombre:"_nombre_1leqv_147",checkbox:"_checkbox_1leqv_177"};function Q_(){const e=tn(),[n,t]=h.useState(null);if(!e)return null;const{state:o,todasLasColumnas:a,etiquetaColumna:i,cambiarOrdenColumnas:s}=e,{ordenColumnas:l,maxColumnasVisibles:c=10}=o,_=a.filter(m=>m.getIsVisible()).length>=c,g=m=>p=>{t(m),p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",m)},f=m=>p=>{p.preventDefault(),!(!n||n===m)&&s?.(v=>{const y=[...v],w=y.indexOf(n),C=y.indexOf(m);return w===-1||C===-1?v:(y.splice(w,1),y.splice(C,0,n),y)})},d=()=>t(null);return r.jsx("div",{className:nn.contenedor,children:r.jsx("ul",{className:nn.lista,children:l.map(m=>{const p=a.find(k=>k.id===m);if(!p)return null;const v=p.getCanHide?.()??!0,y=p.getIsVisible(),w=n===p.id,C=!v||!y&&_;return r.jsxs("li",{className:`${nn.item} ${w?nn.item_dragging:""} ${C?nn.item_deshabilitado:""}`,draggable:!C,onDragStart:g(p.id),onDragOver:f(p.id),onDrop:d,onDragEnd:d,title:!y&&_?`Límite de ${c} columnas visibles alcanzado`:void 0,children:[r.jsx("span",{className:nn.icono_drag,"aria-label":"Arrastrar columna",children:r.jsx(q_,{})}),r.jsx("span",{className:nn.nombre,children:i(p.id)}),r.jsx(En,{size:"md",color:"primary",isSelected:y,isDisabled:C,onChange:k=>p.toggleVisibility(k),className:nn.checkbox})]},p.id)})})})}const Kn={contenido:"_contenido_1oed5_1",descripcion:"_descripcion_1oed5_15",control:"_control_1oed5_31",valor:"_valor_1oed5_45",input:"_input_1oed5_67"};function R_(){const e=tn(),[n,t]=h.useState(""),o=h.useRef(null),a=e?.state.table?.getState().pagination.pageSize??10;if(h.useEffect(()=>t(String(a)),[a]),!e)return null;const{cambiarPageSize:i}=e,s=g=>Math.max(da,Math.min(ua,g)),l=g=>{const f=a+g;f>=da&&f<=ua&&i?.(f)},c=()=>{const g=parseInt(n,10),f=!isNaN(g)&&g>0?s(g):a;i?.(f),t(String(f))},u=g=>{({Enter:()=>{c(),o.current?.blur()},Escape:()=>{t(String(a)),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]?.()},_=g=>{const f=g.target.value;(f===""||/^\d+$/.test(f))&&t(f)};return r.jsxs("div",{className:Kn.contenido,children:[r.jsx("p",{className:Kn.descripcion,children:"Ajusta la cantidad de filas que se muestran por página en la tabla."}),r.jsxs("div",{className:Kn.control,children:[r.jsx(Ze,{isIconOnly:!0,radius:"lg",variant:"light",onClick:()=>l(-1),"aria-label":"Disminuir filas",disabled:a<=da,children:r.jsx(Z_,{style:{fontSize:"var(--gaps-6)"}})}),r.jsx("div",{className:Kn.valor,children:r.jsx("input",{ref:o,type:"text",inputMode:"numeric",value:n,onChange:_,onKeyDown:u,onFocus:()=>o.current?.select(),onBlur:c,className:Kn.input,"aria-label":"Número de filas por página"})}),r.jsx(Ze,{isIconOnly:!0,radius:"lg",variant:"light",onClick:()=>l(1),"aria-label":"Aumentar filas",disabled:a>=ua,children:r.jsx(G_,{})})]})]})}const gt={contenedor:"_contenedor_1lwmx_1",menu:"_menu_1lwmx_11",item:"_item_1lwmx_25",icono_contenedor:"_icono_contenedor_1lwmx_111",icono_restaurar:"_icono_restaurar_1lwmx_143",texto:"_texto_1lwmx_153",nombre:"_nombre_1lwmx_165",descripcion:"_descripcion_1lwmx_183",chevron:"_chevron_1lwmx_201",divider:"_divider_1lwmx_227"};function ef({navegar:e}){const n=tn();return r.jsxs("div",{className:gt.contenedor,children:[r.jsx("nav",{className:gt.menu,children:of.map(({id:t,icono:o,nombre:a,descripcion:i})=>r.jsxs("button",{className:gt.item,onClick:()=>e(t),children:[r.jsx("div",{className:gt.icono_contenedor,children:r.jsx(o,{})}),r.jsxs("div",{className:gt.texto,children:[r.jsx("span",{className:gt.nombre,children:a}),r.jsx("span",{className:gt.descripcion,children:i})]}),r.jsx(Ds,{className:gt.chevron})]},t))}),r.jsx("div",{className:gt.divider}),r.jsx("div",{className:gt.menu,children:r.jsxs("button",{className:gt.item,onClick:n?.restaurarConfiguracion,children:[r.jsx("div",{className:gt.icono_contenedor,children:r.jsx(j_,{className:gt.icono_restaurar})}),r.jsxs("div",{className:gt.texto,children:[r.jsx("span",{className:gt.nombre,children:"Restaurar configuración"}),r.jsx("span",{className:gt.descripcion,children:"Volver a valores por defecto"})]})]})})]})}const da=1,ua=200,Ps=250,tf=200,nf={panelPrincipal:{component:ef},panelColumnas:{component:Q_,titulo:"Columnas visibles"},panelFilas:{component:R_,titulo:"Filas por página"}},of=[{id:"panelColumnas",icono:H_,nombre:"Columnas visibles",descripcion:"Mostrar u ocultar columnas"},{id:"panelFilas",icono:W_,nombre:"Filas por página",descripcion:"Ajustar cantidad de filas"}];function rf(e,n,t){const o=h.useRef(t);o.current=t;const a=h.useRef(e);a.current=e;const i=h.useCallback(s=>{const l=s.target;o.current.some(u=>u.current?.contains(l))||a.current()},[]);h.useEffect(()=>{if(!n)return;const s=setTimeout(()=>{document.addEventListener("mousedown",i)},100);return()=>{clearTimeout(s),document.removeEventListener("mousedown",i)}},[n,i])}function Ts(e,n){h.useEffect(()=>{if(!n)return;const t=o=>{o.key==="Escape"&&e()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[n,e])}function af(e,n,t,{width:o,offsetRight:a=0,offsetLeft:i=0,offsetTop:s=0,offsetBottom:l=0,shiftPadding:c=8}){const[u,_]=h.useState({top:0,left:0}),g=Hr("only screen and (max-width: 480px)"),f=h.useCallback(()=>{if(!e.current)return{top:0,left:0};const d=e.current.getBoundingClientRect(),m=c;let p=d.bottom+s,v=0;g?v=d.right-o-i+a:v=d.right-o+a-i;const y=n.current?.offsetHeight||400;p+y>window.innerHeight-m&&(p=d.top-y-l,p<m&&(p=m));const w=m,C=window.innerWidth-o-m;return v=Math.max(w,Math.min(v,C)),{top:p,left:v}},[g,o,a,i,s,l,c,e,n]);return h.useEffect(()=>{if(!t||!e.current)return;const d=()=>{_(f())};return d(),window.addEventListener("resize",d),window.addEventListener("scroll",d,!0),()=>{window.removeEventListener("resize",d),window.removeEventListener("scroll",d,!0)}},[t,f,e]),u}function sf(e){h.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e])}function lf(){const[e,n]=h.useState(!1),[t,o]=h.useState(!1),[a,i]=h.useState("panelPrincipal"),[s,l]=h.useState(null),c=h.useRef(null),u=h.useRef(null),_=h.useRef(null);sf(t),rf(()=>f(),t,[c,u]),Ts(()=>f(),t);const g=af(c,u,t,{width:Ps,offsetRight:6,offsetTop:-2,shiftPadding:8});h.useEffect(()=>{e&&(o(!0),l(null))},[e]),h.useEffect(()=>()=>{_.current&&clearTimeout(_.current)},[]);function f(){t&&(n(!1),_.current=window.setTimeout(()=>{o(!1),i("panelPrincipal"),l(null)},tf))}function d(v){l(v==="panelPrincipal"?"backward":"forward"),i(v)}const m=nf[a],p=m.component;return r.jsxs("div",{ref:c,className:Gt.contenedor,children:[r.jsx(Ze,{isIconOnly:!0,variant:"light",onClick:()=>t?f():n(!0),"aria-haspopup":"dialog","aria-expanded":t,"aria-label":"Configurar tabla",children:r.jsx(B_,{})}),t&&c.current&&Fn.createPortal(r.jsx("div",{ref:u,className:`${Gt.popover} ${e?Gt.popover_entrada:Gt.popover_salida}`,role:"dialog",style:{top:`${g.top}px`,left:`${g.left}px`,width:Ps},children:r.jsx("div",{className:Gt.ventana,children:r.jsxs("div",{className:ne([Gt.panel,Gt[`panel_${s}`]]),children:[m.titulo&&r.jsx(J_,{titulo:m.titulo,onBack:()=>d("panelPrincipal")}),r.jsx(p,{navegar:d})]},a)})}),document.body)]})}function cf(){const e=tn();if(!e)return null;const{state:n}=e,{inputBusqueda:t,setInputBusqueda:o,loading:a,filtros:i,actualizarTabla:s,descargarExcel:l,paginacion:c}=n,{abrirFiltros:u,filtrosAplicados:_=[]}=i||{},g=_?.length||0;return r.jsxs("section",{className:We.contenedor_superior,children:[r.jsxs("div",{className:We.input_con_icono,id:"buscador-tabla",children:[r.jsx(P_,{className:We.icono_busqueda}),r.jsx("input",{type:"text",placeholder:"Buscar en tabla...",value:t??"",onChange:f=>o&&o(f.target.value),className:We.input_busqueda})]}),r.jsxs("div",{className:We.contenedor_acciones_botones,children:[r.jsxs("div",{className:We.contenedor_acciones,children:[c?.hayMasDatos&&r.jsxs(Ze,{id:"cargar-mas-datos",variant:"light",className:We.boton_basico,disabled:a,onClick:c.onCargarMasDatos,children:[r.jsx(K_,{}),a?"Actualizando...":"Más datos"]}),u!==void 0&&r.jsxs(Ze,{id:"boton-filtros",onClick:u,variant:"light",className:We.boton_basico,children:[r.jsx(O_,{})," Filtros"]}),g>0?r.jsxs("div",{className:We.texto_filtros,id:"filtros-aplicados",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.4em",height:"1.4em",viewBox:"0 0 24 24",children:r.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6h16M6 12h12m-9 6h2m4 0l2 2l4-4"})}),r.jsx("p",{children:L_(_,g)})]}):null]}),l!==void 0?r.jsxs(Ze,{onClick:l,color:"success",variant:"faded",children:[r.jsx(T_,{})," Excel"]}):null]}),r.jsxs("div",{className:We.contenedor_acciones,children:[s!==void 0&&r.jsx(_n,{content:"Actualiza los últimos datos guardados",children:r.jsx(Ze,{id:"actualizar-tabla",variant:"light",isIconOnly:!0,className:We.boton_basico,disabled:s?.cargando,onClick:s?.onClick,children:r.jsx(V_,{})})}),r.jsx("div",{className:We.menu_configuraciones,id:"configuraciones-tabla",children:r.jsx(lf,{})})]})]})}const Pt={contenedor_paginacion:"_contenedor_paginacion_mu230_1",info_paginacion:"_info_paginacion_mu230_23",contenedor_botones:"_contenedor_botones_mu230_39",boton_paginacion:"_boton_paginacion_mu230_97",pagina_activa:"_pagina_activa_mu230_143",boton_num_paginacion:"_boton_num_paginacion_mu230_155"};function df(){const e=tn();if(!e)return null;const{state:n}=e,{table:t}=n,o=t.getPrePaginationRowModel().rows.length,a=t.getPageCount()||1,{pageIndex:i}=t.getState().pagination,s=i+1,l=I_(s,a),c=t.getCanPreviousPage(),u=t.getCanNextPage(),_=a>1,g=i===0,f=i===a-1,d=()=>{c&&t.previousPage()},m=()=>{u&&t.nextPage()},p=w=>{t.setPageIndex(w-1)},v=()=>{g||t.firstPage()},y=()=>{f||t.lastPage()};return r.jsxs("section",{className:Pt.contenedor_paginacion,id:"paginacion-tabla",children:[r.jsxs("p",{className:Pt.info_paginacion,id:"paginacion-total-documentos",children:["Documentos: ",o]}),_&&r.jsxs("div",{className:Pt.contenedor_botones,id:"paginacion-numerador-pags",children:[!g&&r.jsx(X_,{id:"paginacion-flecha-inicio",onClick:v,"aria-label":"Ir a la primera página","aria-disabled":g,className:Pt.boton_paginacion}),c&&r.jsx(As,{id:"paginacion-flecha-izq",onClick:d,"aria-disabled":!c,className:Pt.boton_paginacion}),r.jsx("div",{id:"paginacion-numero-pag",children:l.map(w=>r.jsx("button",{type:"button",onClick:()=>p(w),"aria-current":w===s?"page":void 0,className:w===s?Pt.pagina_activa:Pt.boton_num_paginacion,children:w},w))}),u&&r.jsx(Ds,{id:"paginacion-flecha-der",onClick:m,"aria-disabled":!u,className:Pt.boton_paginacion}),!f&&r.jsx(Y_,{id:"paginacion-flecha-fin",onClick:y,"aria-label":"Ir a la última página","aria-disabled":f,className:Pt.boton_paginacion})]}),r.jsxs("p",{className:Pt.info_paginacion,id:"paginacion-total-pags",children:["Página ",s," de ",a]})]})}const De={contenedor_tabla_cards:"_contenedor_tabla_cards_zuvsb_1",contenedor_card:"_contenedor_card_zuvsb_11",contenedor_encabezado_card:"_contenedor_encabezado_card_zuvsb_25",contenedor_columna_card:"_contenedor_columna_card_zuvsb_47",card_label:"_card_label_zuvsb_57",card_valor:"_card_valor_zuvsb_69",card_segundo_valor:"_card_segundo_valor_zuvsb_83",contenedor_contenido_cards:"_contenedor_contenido_cards_zuvsb_93",contenedor_fila_card:"_contenedor_fila_card_zuvsb_105",card_fila_label:"_card_fila_label_zuvsb_119",card_fila_valor:"_card_fila_valor_zuvsb_137",contenedor_acciones_card:"_contenedor_acciones_card_zuvsb_153",boton_acciones:"_boton_acciones_zuvsb_171",boton_card:"_boton_card_zuvsb_207",boton_personalizado:"_boton_personalizado_zuvsb_237"};function Os(e,n){if(n)return e.find(t=>t.accessorKey===n||t.id!==void 0&&t.id===String(n))}function Vs(e){if(e)return e.id??e.accessorKey}const Zt={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 uf({filas:e,cantidadControles:n=0,table:t,idPrimeraColumna:o,idSegundaColumna:a}){const s=t.getAllLeafColumns().filter(c=>c.id!=="actions"&&c.id!==o&&c.id!==a),l=["25vw","30vw","20vw","28vw","22vw","26vw"];return r.jsx("section",{className:De.contenedor_tabla_cards,children:Array.from({length:e}).map((c,u)=>r.jsxs("article",{className:De.contenedor_card,children:[r.jsxs("div",{className:De.contenedor_encabezado_card,children:[r.jsx("div",{className:De.contenedor_columna_card,children:o&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:De.card_label,children:Mn(o,t)}),r.jsx("div",{className:De.card_valor,children:r.jsx("div",{className:`${Zt.skeleton_elemento} ${Zt.skeleton_elemento_encabezado}`})})]})}),r.jsx("div",{className:De.contenedor_columna_card,children:a&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:De.card_label,children:Mn(a,t)}),r.jsx("div",{className:De.card_segundo_valor,children:r.jsx("div",{className:`${Zt.skeleton_elemento} ${Zt.skeleton_elemento_encabezado_segundo}`})})]})})]}),r.jsx("div",{className:De.contenedor_contenido_cards,children:s.map((_,g)=>r.jsxs("div",{className:De.contenedor_fila_card,children:[r.jsx("div",{className:De.card_fila_label,children:Mn(_.id,t)}),r.jsx("div",{className:De.card_fila_valor,children:r.jsx("div",{className:`${Zt.skeleton_elemento} ${Zt.skeleton_elemento_contenido}`,style:{width:l[g%l.length]}})})]},_.id))}),n>0&&r.jsx("div",{className:De.contenedor_acciones_card,children:Array.from({length:Math.min(n,3)}).map((_,g)=>r.jsx("div",{className:Zt.skeleton_accion,children:r.jsx("div",{className:`${Zt.skeleton_elemento} ${Zt.skeleton_elemento_encabezado}`})},`accion-${g}`))})]},`skeleton-card-${u}`))})}const fn={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"};function Bs(){const e=h.useContext(ca),{sinDatosProps:n}=e?.state||{},{botonAccion:t,titulo:o="No se encontraron coincidencias",descripcion:a='Usa el botón "Filtros" para ampliar tu búsqueda.'}=n||{};return r.jsxs("div",{className:fn.contenedor,children:[r.jsx(_f,{}),r.jsxs("div",{className:fn.envolvedor_contenido,children:[r.jsx(ff,{}),r.jsx("h3",{className:fn.titulo,children:o}),r.jsx("p",{className:fn.descripcion,children:a}),t]})]})}function _f(){return r.jsx("div",{className:fn.envolvedor_cuadricula,children:r.jsxs("svg",{className:fn.svg_cuadricula,width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[r.jsx("defs",{children:r.jsx("pattern",{id:"patronCuadricula",width:"40",height:"40",patternUnits:"userSpaceOnUse",children:r.jsx("path",{d:"M 40 0 L 0 0 0 40",fill:"none",stroke:"currentColor",strokeWidth:"1"})})}),r.jsx("rect",{width:"100%",height:"100%",fill:"url(#patronCuadricula)"})]})})}function ff(){return r.jsxs("svg",{className:fn.icono_carpeta,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r.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)"}),r.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"}),r.jsx("circle",{cx:"35",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),r.jsx("circle",{cx:"55",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),r.jsx("path",{d:"M42 65H48",stroke:"var(--color-primary-text)",strokeWidth:"1.5",strokeLinecap:"round"}),r.jsx("circle",{cx:"78",cy:"78",r:"14",fill:"var(--brand-primary)"}),r.jsx("path",{d:"M78 71V85M71 78H85",stroke:"var(--base)",strokeWidth:"2.5",strokeLinecap:"round"})]})}const pf=({fila:e,controls:n})=>(n?.length??0)>0?r.jsx("div",{className:De.contenedor_acciones_card,children:n?.filter(o=>!o.visible||o.visible(e.original)).map(o=>"contenido"in o?r.jsxs("span",{className:`${De.boton_personalizado} ${De.boton_acciones} ${De.boton_card}`,onClick:a=>{const i=a.currentTarget.querySelector("button");i&&!i.contains(a.target)&&i.click()},children:[o.contenido(e.original)," ",o.nombre]},o.id):r.jsxs("button",{id:o.id,type:"button",title:o.nombre,onClick:()=>o.evento(e.original),className:`${De.boton_acciones} ${De.boton_card}`,children:[o.icono," ",o.nombre]},o.id))}):null,gf=({columnasRestantes:e,table:n})=>e.length===0?null:r.jsx("div",{className:De.contenedor_contenido_cards,children:e.map(t=>r.jsxs("div",{className:De.contenedor_fila_card,children:[r.jsx("div",{className:De.card_fila_label,children:Mn(t.column.id,n)}),r.jsx("div",{className:De.card_fila_valor,children:Nn(t.column.columnDef.cell,t.getContext())})]},t.id))}),hf=({fila:e,table:n,idPrimeraColumna:t,idSegundaColumna:o})=>{const a=Fs(e,t),i=Fs(e,o);return r.jsxs("div",{className:De.contenedor_encabezado_card,children:[r.jsx("div",{className:De.contenedor_columna_card,children:t&&a&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:De.card_label,children:Mn(t,n)}),r.jsx("div",{className:De.card_valor,children:Is(e,t)})]})}),r.jsx("div",{className:De.contenedor_columna_card,children:o&&i&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:De.card_label,children:Mn(o,n)}),r.jsx("div",{className:De.card_segundo_valor,children:Is(e,o)})]})})]})};function mf(){const e=tn();if(!e)return null;const{state:n}=e,{table:t,controls:o,primerasColumnas:a,loading:i,columns:s}=n;if(!t)return null;const l=s&&a?Os(s,a[0]):void 0,c=s&&a?Os(s,a[1]):void 0,u=Vs(l),_=Vs(c);if(i)return r.jsx(uf,{filas:3,cantidadControles:o?.length??0,table:t,idPrimeraColumna:u,idSegundaColumna:_});const g=t.getRowModel().rows;return g.length===0?r.jsx("article",{className:De.contenedor_card,children:r.jsx(Bs,{})}):r.jsx("section",{className:De.contenedor_tabla_cards,children:g.map(f=>{const d=z_(f,u,_);return r.jsxs("article",{id:`tabla-card-${f.id}`,className:De.contenedor_card,children:[r.jsx(hf,{fila:f,table:t,idPrimeraColumna:u,idSegundaColumna:_}),r.jsx(gf,{columnasRestantes:d,table:t}),r.jsx(pf,{fila:f,controls:o})]},f.id)})})}const js={filas:"_filas_17736_1",columnas:"_columnas_17736_33"},vf=({columnas:e,filas:n})=>r.jsx(r.Fragment,{children:Array.from({length:n}).map((t,o)=>r.jsx("tr",{className:js.filas,children:Array.from({length:e}).map((a,i)=>r.jsx("td",{className:js.columnas},`sk-cell-${o}-${i}`))},`sk-row-${o}`))}),pn={contenedor:"_contenedor_5uhpi_1",barra:"_barra_5uhpi_21",info:"_info_5uhpi_49",btn_cerrar:"_btn_cerrar_5uhpi_63",contador:"_contador_5uhpi_79",separador:"_separador_5uhpi_97",acciones:"_acciones_5uhpi_111"};function bf({totalSeleccionadas:e,acciones:n,filasSeleccionadas:t,onLimpiarSeleccion:o}){const[a,i]=h.useState(0),[s,l]=h.useState([]),[c,u]=h.useState([]),_=e>0,g=h.useRef(null);return Ts(o,_),h.useEffect(()=>{_&&(i(e),l(n),u(t))},[e,n,t,_]),r.jsx(oo,{mostrar:_,tipo:"escalar",className:pn.contenedor,children:r.jsxs("div",{ref:g,className:pn.barra,children:[r.jsxs("div",{className:pn.info,children:[r.jsx(Ze,{isIconOnly:!0,variant:"light",color:"default",size:"md",radius:"md",onClick:o,"aria-label":"Limpiar selección",className:pn.btn_cerrar,children:r.jsx(U_,{})}),r.jsxs("p",{className:pn.contador,children:[a," filas seleccionadas"]})]}),r.jsx("div",{className:pn.separador}),r.jsx("div",{className:pn.acciones,children:s.map(f=>r.jsx("div",{children:f.componente(c)},f.id))})]})})}function wf({dir:e}){return e?e==="asc"?r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:We.icono_orden,"aria-hidden":"true",children:r.jsx("path",{fill:"currentColor",d:"m12 10.8l-4.6 4.6L6 14l6-6l6 6l-1.4 1.4z"})}):r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:We.icono_orden,"aria-hidden":"true",children:r.jsx("path",{fill:"currentColor",d:"M12 13.2L7.4 8.6L6 10l6 6l6-6l-1.4-1.4z"})}):null}function yf(){const e=tn();if(!e)return null;const{state:n}=e,{table:t,loading:o,selectorFilas:a=[]}=n;if(!t)return null;const i=t.getHeaderGroups(),s=t.getRowModel().rows,l=t.getVisibleLeafColumns().length,c=t.getState().pagination.pageIndex,u=t.getSelectedRowModel().rows,_=u.length,g=()=>{t.resetRowSelection()};return r.jsxs(r.Fragment,{children:[r.jsx("div",{className:We.wrapper_scroll_tabla,children:r.jsxs("table",{className:We.contenedor_tabla,children:[r.jsx("thead",{children:i.map(f=>r.jsx("tr",{children:f.headers.map(d=>{const m=d.column.columnDef.meta?.style;return r.jsx("th",{id:`tabla-col-${d.id}`,className:We.encabezados,style:m,"data-columna":d.id,children:d.id==="select"?r.jsx("div",{children:Nn(d.column.columnDef.header,d.getContext())}):r.jsxs("div",{className:We.contenido_encabezado,style:{justifyContent:m?.textAlign==="center"?"center":m?.textAlign==="right"?"flex-end":void 0},onClick:d.column.getToggleSortingHandler(),children:[Nn(d.column.columnDef.header,d.getContext()),r.jsx(wf,{dir:d.column.getIsSorted()})]})},d.id)})},f.id))}),r.jsx("tbody",{className:We.contenedor_datos,children:o?r.jsx(vf,{columnas:l,filas:10}):s.length===0?r.jsx("tr",{children:r.jsx("td",{colSpan:l,style:{backgroundColor:"var(--base)"},children:r.jsx(Bs,{})})}):s.map(f=>r.jsx("tr",{id:`tabla-fila-${f.id}`,className:`${We.datos} ${f.getIsSelected()?We.seleccionada:""}`,"data-fila-index":f.index,children:f.getVisibleCells().map(d=>{const m=d.column.columnDef.meta?.style;return r.jsx("td",{className:We.columna,style:m,"data-columna":d.column.id,children:Nn(d.column.columnDef.cell,d.getContext())},d.id)})},f.id))},c)]})}),a?.length>0?r.jsx(bf,{totalSeleccionadas:_,acciones:a,filasSeleccionadas:u.map(f=>f.original),onLimpiarSeleccion:g}):null]})}const Cf=830;function xf({id:e}){const n=h.useRef(null),[t,o]=h.useState(!1);return h.useEffect(()=>{const a=n.current;if(!a)return;const i=new ResizeObserver(([s])=>{o(s.contentRect.width<=Cf)});return i.observe(a),()=>i.disconnect()},[]),r.jsxs("main",{className:We.contenedor,id:e,ref:n,children:[r.jsx(cf,{}),r.jsxs("div",{className:We.tabla_card,children:[t?r.jsx(mf,{}):r.jsx(yf,{}),r.jsx(df,{})]})]})}function $f({id:e,...n}){return r.jsx(A_,{...n,children:r.jsx(xf,{id:e})})}const Ve={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"},qs=h.createContext(void 0),Sf=()=>h.useContext(qs),_a=h.memo(h.forwardRef(({value:e,label:n,description:t,size:o="md",color:a="primary",customColor:i,variant:s="default",isDisabled:l=!1,isReadOnly:c=!1,isInvalid:u=!1,isRequired:_=!1,children:g,className:f="",onChange:d,...m},p)=>{const v=Sf(),y=h.useId(),w=m.id||y,C=v?.name||m.name,k=v?.size||o,z=v?.color||a,A=v?.customColor||i,N=v?.variant||s,P=v?.isDisabled||l,O=v?.isReadOnly||c,E=v?.isInvalid||u,T=v?.isRequired||_,V=v?.value!==void 0?v.value===e:void 0,S=g||n,b=I=>{P||O||(v?.onChange&&v.onChange(e),d&&d(I))},x=[Ve.contenedor_radio,Ve[`tam_${k}`],!A&&Ve[`color_${z}`],Ve[`variante_${N}`],P&&Ve.deshabilitado,O&&Ve.solo_lectura,E&&Ve.invalido,V&&Ve.seleccionado,f].filter(Boolean).join(" "),F=A?{"--radio-custom-color":A}:void 0;return r.jsx("div",{className:x,style:F,children:r.jsxs("label",{className:Ve.envoltorio_radio,htmlFor:w,children:[r.jsxs("div",{className:Ve.radio,children:[r.jsx("input",{ref:p,type:"radio",id:w,name:C,value:e,checked:V,disabled:P,readOnly:O,required:T,"aria-invalid":E,className:Ve.input,onChange:b,...m}),r.jsx("div",{className:Ve.circulo_radio,children:r.jsx("div",{className:Ve.punto_radio})})]})," ",S&&r.jsxs("div",{className:Ve.contenedor_label,children:[r.jsxs("span",{className:Ve.texto_label,children:[S,_&&!v&&r.jsx("span",{className:Ve.marca_requerido,children:" *"})]}),t&&r.jsx("span",{className:Ve.texto_descripcion,children:t})]})]})})}));_a.displayName="Radio";const Hs=({name:e,value:n,defaultValue:t,onChange:o,orientation:a="horizontal",label:i,description:s,isDisabled:l=!1,isReadOnly:c=!1,isRequired:u=!1,isInvalid:_=!1,errorMessage:g,size:f,color:d,customColor:m,variant:p,justifyContent:v="flex-start",children:y,className:w="",options:C,optionValueKey:k,optionLabelKey:z,optionDisabledKey:A,optionDescriptionKey:N})=>{const[P,O]=h.useState(String(t??"")),E=n!==void 0?String(n):P,V={name:e,value:E,onChange:x=>{l||c||(n===void 0&&O(x),o&&o(x))},size:f,color:d,customColor:m,variant:p,isDisabled:l,isReadOnly:c,isInvalid:_,isRequired:u},S=[Ve.grupo_radio,Ve[`orientacion_${a}`],_&&Ve.grupo_invalido,l&&Ve.grupo_deshabilitado,c&&Ve.grupo_solo_lectura,w].filter(Boolean).join(" "),b=v==="center"?"center":v==="flex-end"?"right":"left";return r.jsx(qs.Provider,{value:V,children:r.jsxs("div",{className:S,role:"radiogroup","aria-required":u,"aria-invalid":_,style:{textAlign:b},children:[i&&r.jsxs("div",{className:Ve.encabezado_grupo,children:[r.jsxs("label",{className:Ve.label_grupo,children:[i,u&&r.jsx("span",{className:Ve.marca_requerido,children:" *"})]}),s&&r.jsx("span",{className:Ve.descripcion_grupo,children:s})]}),r.jsx("div",{className:Ve.contenedor_radios,style:{justifyContent:v},children:C&&C.length>0?C.map((x,F)=>{let I,$,D=!1,B;if(typeof x=="object"&&x!==null){const X=k??"value",U=z??"label",L=A??"isDisabled",j=N??"description",W=x[X],ie=x[U];I=String(W!==void 0?W:F),$=ie;const re=x[L];D=typeof re=="boolean"?re:!1;const ae=x[j];B=typeof ae=="string"?ae:void 0}else I=String(x),$=x;return r.jsx(_a,{value:I,isDisabled:D,description:B,children:$},I)}):y}),_&&g&&r.jsx("span",{className:Ve.mensaje_error,children:g})]})})};Hs.displayName="RadioGroup";const ht={backdrop:"_backdrop_rup7e_1",visible:"_visible_rup7e_39",drawer:"_drawer_rup7e_73",posicion_right:"_posicion_right_rup7e_137",drawer_detras:"_drawer_detras_rup7e_171",posicion_left:"_posicion_left_rup7e_179",posicion_top:"_posicion_top_rup7e_221",posicion_bottom:"_posicion_bottom_rup7e_263",radio_none:"_radio_none_rup7e_305",radio_sm:"_radio_sm_rup7e_313",radio_md:"_radio_md_rup7e_333",radio_lg:"_radio_lg_rup7e_353",radio_xl:"_radio_xl_rup7e_373",tamano_auto:"_tamano_auto_rup7e_473",tamano_sm:"_tamano_sm_rup7e_497",tamano_md:"_tamano_md_rup7e_507",tamano_lg:"_tamano_lg_rup7e_517",tamano_xl:"_tamano_xl_rup7e_527",tamano_full:"_tamano_full_rup7e_537",encabezado:"_encabezado_rup7e_597",titulo:"_titulo_rup7e_617",boton_cerrar:"_boton_cerrar_rup7e_637",contenido:"_contenido_rup7e_691",pie:"_pie_rup7e_705",loading_overlay:"_loading_overlay_rup7e_725",spinner:"_spinner_rup7e_749",spin:"_spin_rup7e_749",loading_text:"_loading_text_rup7e_779",resize_handle:"_resize_handle_rup7e_791"},Ws=h.forwardRef(({isOpen:e,onClose:n,position:t="right",size:o="md",title:a,showCloseButton:i=!0,closeOnBackdropClick:s=!0,closeOnEscape:l=!0,preventScroll:c=!0,header:u,footer:_,children:g,className:f="",contentClassName:d="",isLoading:m=!1,loadingMessage:p="Cargando...",onOpen:v,backdropVariant:y="normal",radius:w,resizable:C=!1,zIndex:k,getContainer:z},A)=>{const N=h.useRef(null),[P,O]=h.useState(!1),E=h.useCallback(()=>{P||(O(!0),setTimeout(()=>{n?.(),O(!1)},300))},[n,P]);h.useEffect(()=>{e&&O(!1)},[e]),h.useEffect(()=>{if(e){if(v?.(),c){const L=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",L>0&&(document.body.style.paddingRight=`${L}px`)}if(l){const L=j=>{j.key==="Escape"&&E()};return document.addEventListener("keydown",L),()=>{document.removeEventListener("keydown",L),c&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{c&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,E,l,c,v]);const T=L=>{s&&L.target===N.current&&E()},V=w?ht[`radio_${w}`]:void 0,S=e&&!P,b=[ht.drawer,ht[`posicion_${t}`],ht[`tamano_${o}`],S&&ht.visible,V,f].filter(Boolean).join(" "),x=[ht.contenido,d].filter(Boolean).join(" "),F=[ht.backdrop,S&&ht.visible].filter(Boolean).join(" "),I=k||500,$={transparente:{opacity:0},sutil:{opacity:.2},normal:{opacity:.4},intermedio:{opacity:.6},intenso:{opacity:.8}},D=$[y]||$.normal,{opacity:B}=D,X={background:`rgb(0 0 0 / ${B})`,zIndex:I,...z&&{position:"absolute"}},U=r.jsx("div",{className:F,ref:N,onClick:T,style:X,children:r.jsxs("div",{ref:A,className:b,role:"dialog","aria-modal":"true","aria-labelledby":"drawer-title",children:[(a||u)&&r.jsx("div",{className:ht.encabezado,children:u||r.jsxs(r.Fragment,{children:[r.jsx("h2",{id:"drawer-title",className:ht.titulo,children:a}),i&&r.jsx("button",{type:"button",className:ht.boton_cerrar,onClick:E,"aria-label":"Cerrar",children:r.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:r.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}),r.jsx("div",{className:x,children:g}),_&&r.jsx("div",{className:ht.pie,children:_}),m&&r.jsxs("div",{className:ht.loading_overlay,children:[r.jsx("div",{className:ht.spinner}),r.jsx("span",{className:ht.loading_text,children:p})]}),C&&r.jsx("div",{className:ht.resize_handle})]})});if(z){const L=typeof z=="function"?z():z;if(L&&L instanceof HTMLElement)return Fn.createPortal(U,L)}return U});Ws.displayName="Drawer";const Qe={backdrop:"_backdrop_li82t_1",visible:"_visible_li82t_41",centrado:"_centrado_li82t_65",modal:"_modal_li82t_73",tamano_sm:"_tamano_sm_li82t_145",tamano_md:"_tamano_md_li82t_153",tamano_lg:"_tamano_lg_li82t_161",tamano_xl:"_tamano_xl_li82t_169",tamano_formulario:"_tamano_formulario_li82t_177",tamano_full:"_tamano_full_li82t_185",tamano_auto:"_tamano_auto_li82t_193",encabezado:"_encabezado_li82t_203",encabezado_custom:"_encabezado_custom_li82t_221",contenedor_titulo_completo:"_contenedor_titulo_completo_li82t_233",contenedor_titulo_icono:"_contenedor_titulo_icono_li82t_243",icono_titulo:"_icono_titulo_li82t_255",titulo:"_titulo_li82t_269",contenido:"_contenido_li82t_289",pie:"_pie_li82t_303",loading_overlay:"_loading_overlay_li82t_323",spinner:"_spinner_li82t_349",spinner_dot:"_spinner_dot_li82t_365",loadingBounce:"_loadingBounce_li82t_1",loading_text:"_loading_text_li82t_433",radius_none:"_radius_none_li82t_447",radius_sm:"_radius_sm_li82t_455",radius_md:"_radius_md_li82t_463",radius_lg:"_radius_lg_li82t_471",radius_full:"_radius_full_li82t_479",close_button:"_close_button_li82t_487",texto_esc:"_texto_esc_li82t_579"},fa=h.forwardRef(({isOpen:e,onClose:n,size:t="md",title:o,titleIcon:a,closeOnBackdropClick:i=!1,closeOnEscape:s=!0,preventScroll:l=!0,isCentered:c=!0,header:u,footer:_,children:g,className:f="",contentClassName:d="",isLoading:m=!1,loadingMessage:p="Cargando...",backdropVariant:v="normal",showIconTitle:y=!1,onOpen:w,radius:C="lg",showCloseButton:k=!1},z)=>{const A=h.useRef(null),N=h.useCallback(()=>{m||n?.()},[n,m]);h.useEffect(()=>{if(e){if(w?.(),l){const x=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",x>0&&(document.body.style.paddingRight=`${x}px`)}if(s){const x=F=>{F.key==="Escape"&&N()};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x),l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,N,s,l,w]);const P=x=>{i&&x.target===A.current&&N()},O=[Qe.backdrop,c&&Qe.centrado,e&&Qe.visible].filter(Boolean).join(" "),E=[Qe.modal,Qe[`tamano_${t}`],Qe[`radius_${C}`],f].filter(Boolean).join(" "),T=[Qe.contenido,d].filter(Boolean).join(" "),V={transparente:{opacity:0},sutil:{opacity:.3},normal:{opacity:.5},intermedio:{opacity:.7},intenso:{opacity:.9}},{opacity:S}=V[v]||V.normal,b={background:`rgb(0 0 0 / ${S})`};return r.jsx("div",{className:O,ref:A,onClick:P,style:b,children:r.jsxs("div",{ref:z,className:E,role:"dialog","aria-modal":"true","aria-labelledby":"modal-title",children:[(o||u||k)&&r.jsx("div",{className:`${Qe.encabezado}${u?` ${Qe.encabezado_custom}`:""}`,children:u||r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Qe.contenedor_titulo_completo,children:r.jsxs("div",{className:Qe.contenedor_titulo_icono,children:[y&&a!==void 0&&(typeof a=="string"?r.jsx("span",{className:Qe.icono_titulo,children:a}):a),y&&a===void 0&&r.jsx("span",{className:Qe.icono_titulo,children:"📄"}),r.jsx("h2",{id:"modal-title",className:Qe.titulo,children:o})]})}),k&&r.jsxs("button",{type:"button",className:Qe.close_button,onClick:N,"aria-label":"Cerrar",children:[r.jsx("span",{className:Qe.texto_esc,children:"ESC"}),r.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[r.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.08"}),r.jsx("path",{d:"M15 9l-6 6M9 9l6 6",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round"})]})]})]})}),r.jsx("div",{className:T,children:g}),_&&r.jsx("div",{className:Qe.pie,children:_}),m&&r.jsxs("div",{className:Qe.loading_overlay,children:[r.jsxs("div",{className:Qe.spinner,children:[r.jsx("span",{className:Qe.spinner_dot}),r.jsx("span",{className:Qe.spinner_dot}),r.jsx("span",{className:Qe.spinner_dot})]}),r.jsx("span",{className:Qe.loading_text,children:p})]})]})})});fa.displayName="Modal";function kf(e){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 256",...e,children:[r.jsx("path",{fill:"currentColor",d:"M232 128c0 12.5-17.8 22-22.7 33.7s1.4 30.6-7.8 39.8s-28.5 3.1-39.8 7.8S140.5 232 128 232s-22-17.8-33.7-22.7s-30.6 1.4-39.8-7.8s-3.1-28.5-7.8-39.8S24 140.5 24 128s17.8-22 22.7-33.7s-1.4-30.6 7.8-39.8s28.5-3.1 39.8-7.8S115.5 24 128 24s22 17.8 33.7 22.7s30.6-1.4 39.8 7.8s3.1 28.5 7.8 39.8S232 115.5 232 128Z",opacity:".2"}),r.jsx("path",{fill:"currentColor",d:"M225.9 102.8c-3.8-3.9-7.7-8-9.2-11.5s-1.4-8.7-1.5-14c-.1-9.7-.3-20.8-8-28.5s-18.8-7.9-28.5-8c-5.3-.1-10.7-.2-14-1.5s-7.6-5.4-11.5-9.2C146.3 23.5 138.4 16 128 16s-18.3 7.5-25.2 14.1c-3.9 3.8-8 7.7-11.5 9.2s-8.7 1.4-14 1.5c-9.7.1-20.8.3-28.5 8s-7.9 18.8-8 28.5c-.1 5.3-.2 10.7-1.5 14s-5.4 7.6-9.2 11.5C23.5 109.7 16 117.6 16 128s7.5 18.3 14.1 25.2c3.8 3.9 7.7 8 9.2 11.5s1.4 8.7 1.5 14c.1 9.7.3 20.8 8 28.5s18.8 7.9 28.5 8c5.3.1 10.7.2 14 1.5s7.6 5.4 11.5 9.2c6.9 6.6 14.8 14.1 25.2 14.1s18.3-7.5 25.2-14.1c3.9-3.8 8-7.7 11.5-9.2s8.7-1.4 14-1.5c9.7-.1 20.8-.3 28.5-8s7.9-18.8 8-28.5c.1-5.3.2-10.7 1.5-14s5.4-7.6 9.2-11.5c6.6-6.9 14.1-14.8 14.1-25.2s-7.5-18.3-14.1-25.2ZM120 136V80a8 8 0 0 1 16 0v56a8 8 0 0 1-16 0Zm20 36a12 12 0 1 1-12-12a12 12 0 0 1 12 12Z"})]})}function Nf(e){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:[r.jsx("path",{fill:"currentColor",d:"M3 6.386c0-.484.345-.877.771-.877h2.665c.529-.016.996-.399 1.176-.965l.03-.1l.115-.391c.07-.24.131-.45.217-.637c.338-.739.964-1.252 1.687-1.383c.184-.033.378-.033.6-.033h3.478c.223 0 .417 0 .6.033c.723.131 1.35.644 1.687 1.383c.086.187.147.396.218.637l.114.391l.03.1c.18.566.74.95 1.27.965h2.57c.427 0 .772.393.772.877s-.345.877-.771.877H3.77c-.425 0-.77-.393-.77-.877"}),r.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.425 11.482c.413-.044.78.273.821.707l.5 5.263c.041.433-.26.82-.671.864c-.412.043-.78-.273-.821-.707l-.5-5.263c-.041-.434.26-.821.671-.864m5.15 0c.412.043.713.43.671.864l-.5 5.263c-.04.434-.408.75-.82.707c-.413-.044-.713-.43-.672-.864l.5-5.264c.041-.433.409-.75.82-.707",clipRule:"evenodd"}),r.jsx("path",{fill:"currentColor",d:"M11.596 22h.808c2.783 0 4.174 0 5.08-.886c.904-.886.996-2.339 1.181-5.245l.267-4.188c.1-1.577.15-2.366-.303-2.865c-.454-.5-1.22-.5-2.753-.5H8.124c-1.533 0-2.3 0-2.753.5s-.404 1.288-.303 2.865l.267 4.188c.185 2.906.277 4.36 1.182 5.245c.905.886 2.296.886 5.079.886",opacity:".5"})]})}function Ef(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",...e,children:r.jsxs("g",{fill:"currentColor",children:[r.jsxs("g",{opacity:".2",children:[r.jsx("path",{d:"M14.696 12.282a1 1 0 1 1-1.392 1.436a2 2 0 0 0-.102-.09a2.4 2.4 0 0 0-.623-.348c-.453-.18-1-.28-1.579-.28c-.914 0-1.733.251-2.202.629q-.056.044-.102.089a1 1 0 1 1-1.392-1.436q.114-.11.24-.212C8.395 11.387 9.656 11 11 11c.827 0 1.624.146 2.316.42c.43.17.815.389 1.14.65q.126.102.24.212"}),r.jsx("path",{d:"M17.213 9.689a1 1 0 1 1-1.426 1.402a4 4 0 0 0-.312-.285a5.5 5.5 0 0 0-.767-.521a6 6 0 0 0-.932-.425a7 7 0 0 0-1.057-.298a8 8 0 0 0-1.137-.153a9 9 0 0 0-1.74.058a8 8 0 0 0-1.102.227a7 7 0 0 0-1 .364a6 6 0 0 0-.854.477a5 5 0 0 0-.361.27a4 4 0 0 0-.312.286A1 1 0 1 1 4.787 9.69q.218-.22.462-.424q.243-.201.512-.384a7.5 7.5 0 0 1 1.15-.643a9 9 0 0 1 1.286-.469a10 10 0 0 1 1.379-.284A10.5 10.5 0 0 1 11 7.39a11 11 0 0 1 1.424.095a10 10 0 0 1 1.38.284a9 9 0 0 1 1.285.469a8 8 0 0 1 1.15.643q.27.183.512.384q.244.204.462.424"}),r.jsx("path",{d:"M19.245 7.222a1 1 0 0 1-1.49 1.333a6 6 0 0 0-.456-.459a7 7 0 0 0-.52-.43a8.4 8.4 0 0 0-1.215-.747a9 9 0 0 0-1.408-.563a10 10 0 0 0-1.542-.35A11 11 0 0 0 11 5.89a11 11 0 0 0-1.614.117a10.5 10.5 0 0 0-1.542.35a9.6 9.6 0 0 0-1.407.564a8 8 0 0 0-.635.353a8 8 0 0 0-.58.393a7 7 0 0 0-.52.43a6 6 0 0 0-.457.46a1 1 0 0 1-1.49-1.334q.28-.314.6-.604q.316-.29.668-.553q.351-.262.732-.496a10.4 10.4 0 0 1 1.62-.813a11.6 11.6 0 0 1 1.785-.554a12.5 12.5 0 0 1 1.883-.279a13.2 13.2 0 0 1 2.864.105a12.5 12.5 0 0 1 1.842.418a11.6 11.6 0 0 1 1.71.686a10.4 10.4 0 0 1 1.518.933q.351.264.669.553t.6.604M13 16.25a2 2 0 1 1-4 0a2 2 0 0 1 4 0"})]}),r.jsx("path",{d:"M13.348 11.641a.5.5 0 0 1-.696.718a2 2 0 0 0-.136-.12a3 3 0 0 0-.753-.424A4.8 4.8 0 0 0 10 11.5c-1.022 0-1.951.285-2.516.739q-.073.06-.136.12a.5.5 0 0 1-.696-.718q.097-.094.206-.182c.754-.606 1.905-.959 3.142-.959c.765 0 1.5.134 2.132.385c.385.153.726.346 1.01.574q.109.089.206.182m2.508-2.601a.5.5 0 1 1-.712.7a5 5 0 0 0-.35-.32a5 5 0 0 0-.399-.298a6.6 6.6 0 0 0-1.449-.731a8 8 0 0 0-1.126-.319a9 9 0 0 0-1.205-.162a9.3 9.3 0 0 0-1.839.061a9 9 0 0 0-1.172.242a8 8 0 0 0-1.071.39a6.6 6.6 0 0 0-.928.519q-.21.143-.399.298q-.186.155-.35.32a.5.5 0 0 1-.712-.7q.198-.202.424-.39q.225-.186.474-.355a7 7 0 0 1 1.076-.602a8 8 0 0 1 1.215-.443a9 9 0 0 1 1.31-.27A10 10 0 0 1 10 6.89a10 10 0 0 1 1.357.09a10 10 0 0 1 1.31.27a9 9 0 0 1 1.215.443a7.6 7.6 0 0 1 1.076.602q.249.17.474.355q.226.188.424.39"}),r.jsx("path",{d:"M17.873 6.555a.5.5 0 1 1-.746.667a7 7 0 0 0-.492-.496a8 8 0 0 0-.557-.46a9 9 0 0 0-1.29-.794a9.5 9.5 0 0 0-1.484-.594a10.6 10.6 0 0 0-1.617-.366A11.4 11.4 0 0 0 10 4.389a12 12 0 0 0-1.687.123a11 11 0 0 0-1.617.366a10 10 0 0 0-1.483.595a9 9 0 0 0-.673.374a8 8 0 0 0-.618.42q-.294.22-.557.46q-.263.239-.492.495a.5.5 0 1 1-.746-.667q.264-.294.564-.568t.632-.521q.332-.249.694-.471a10 10 0 0 1 1.545-.775a11 11 0 0 1 1.709-.53a12 12 0 0 1 1.808-.268a12.7 12.7 0 0 1 2.754.1a12 12 0 0 1 1.767.401a11 11 0 0 1 1.635.656q.387.194.749.416q.36.222.693.47q.333.249.632.522q.3.274.564.568M11.75 15.25a1.75 1.75 0 1 1-3.5 0a1.75 1.75 0 0 1 3.5 0"}),r.jsx("path",{d:"M1.15 1.878a.514.514 0 0 1 .728-.727l16.971 16.971a.514.514 0 0 1-.727.727z"})]})})}function Mf(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:r.jsx("path",{fill:"currentColor",d:"M13.435 2.075a3.33 3.33 0 0 0-2.87 0c-.394.189-.755.497-1.26.928l-.079.066a2.56 2.56 0 0 1-1.58.655l-.102.008c-.662.053-1.135.09-1.547.236a3.33 3.33 0 0 0-2.03 2.029c-.145.412-.182.885-.235 1.547l-.008.102a2.56 2.56 0 0 1-.655 1.58l-.066.078c-.431.506-.74.867-.928 1.261a3.33 3.33 0 0 0 0 2.87c.189.394.497.755.928 1.26l.066.079c.41.48.604.939.655 1.58l.008.102c.053.662.09 1.135.236 1.547a3.33 3.33 0 0 0 2.029 2.03c.412.145.885.182 1.547.235l.102.008c.629.05 1.09.238 1.58.655l.078.066c.506.431.867.74 1.261.928a3.33 3.33 0 0 0 2.87 0c.394-.189.755-.497 1.26-.928l.079-.066c.48-.41.939-.604 1.58-.655l.102-.008c.662-.053 1.135-.09 1.547-.236a3.33 3.33 0 0 0 2.03-2.029c.145-.412.182-.885.235-1.547l.008-.102c.05-.629.238-1.09.655-1.58l.066-.079c.431-.505.74-.866.928-1.26a3.33 3.33 0 0 0 0-2.87c-.189-.394-.497-.755-.928-1.26l-.066-.079a2.56 2.56 0 0 1-.655-1.58l-.008-.102c-.053-.662-.09-1.135-.236-1.547a3.33 3.33 0 0 0-2.029-2.03c-.412-.145-.885-.182-1.547-.235l-.102-.008a2.56 2.56 0 0 1-1.58-.655l-.079-.066c-.505-.431-.866-.74-1.26-.928M12 7.25a.75.75 0 0 1 .75.75v.5a.75.75 0 0 1-1.5 0V8a.75.75 0 0 1 .75-.75M10.75 16a.75.75 0 0 1 .5-.707v-3.586a.75.75 0 0 1 .25-1.457h.5a.75.75 0 0 1 .75.75v4.293a.75.75 0 0 1-.25 1.457h-1a.75.75 0 0 1-.75-.75"})})}function If(e){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 48 48",...e,children:[r.jsx("defs",{children:r.jsx("mask",{id:"SVG4IxzvcIZ",children:r.jsxs("g",{fill:"none",stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4",children:[r.jsx("path",{fill:"#555",d:"m24 4l5.253 3.832l6.503-.012l1.997 6.188l5.268 3.812L41 24l2.021 6.18l-5.268 3.812l-1.997 6.188l-6.503-.012L24 44l-5.253-3.832l-6.503.012l-1.997-6.188l-5.268-3.812L7 24l-2.021-6.18l5.268-3.812l1.997-6.188l6.503.012z"}),r.jsx("path",{d:"m17 24l5 5l10-10"})]})})}),r.jsx("path",{fill:"currentColor",d:"M0 0h48v48H0z",mask:"url(#SVG4IxzvcIZ)"})]})}const at={contenido:"_contenido_1mizc_1",modal_radio:"_modal_radio_1mizc_11",cuerpo:"_cuerpo_1mizc_19",icono_wrapper:"_icono_wrapper_1mizc_37",icono:"_icono_1mizc_37",icono_personalizado:"_icono_personalizado_1mizc_55",titulo:"_titulo_1mizc_87",mensaje:"_mensaje_1mizc_105",descripcion:"_descripcion_1mizc_123",grupo_botones:"_grupo_botones_1mizc_139",solo_confirmar:"_solo_confirmar_1mizc_155",boton_modal:"_boton_modal_1mizc_163",advertencia:"_advertencia_1mizc_171",eliminar:"_eliminar_1mizc_179",exito:"_exito_1mizc_187",info:"_info_1mizc_195",sin_conexion:"_sin_conexion_1mizc_203",personalizado:"_personalizado_1mizc_211"},Ff={advertencia:kf,eliminar:Nf,exito:If,info:Mf,"sin-conexion":Ef},zf={advertencia:at.advertencia,eliminar:at.eliminar,exito:at.exito,info:at.info,"sin-conexion":at.sin_conexion,personalizado:at.personalizado},Xn=h.forwardRef(({isOpen:e,tipo:n="advertencia",titulo:t,mensaje:o="¿Estás seguro de continuar?",descripcion:a,textoConfirmar:i="Confirmar",textoCancelar:s="Cancelar",onConfirmar:l,onCancelar:c,size:u="sm",closeOnBackdropClick:_=!1,icono:g,loadingConfirmar:f=!1,timeout:d,colorTipo:m,colorBotonConfirmar:p},v)=>{const y=Ff[n],w=n==="exito";h.useEffect(()=>{if(!e||!d)return;const k=setTimeout(l,d);return()=>clearTimeout(k)},[e,d,l]);const C=m?{"--color-tipo":m}:void 0;return r.jsx(fa,{ref:v,isOpen:e,onClose:c,size:u,isCentered:!0,closeOnBackdropClick:_,closeOnEscape:!w,className:at.modal_radio,contentClassName:at.contenido,children:r.jsxs("div",{className:`${at.cuerpo} ${zf[n]}`,style:C,children:[r.jsx("div",{className:at.icono_wrapper,children:g?r.jsx("span",{className:at.icono_personalizado,"aria-hidden":"true",children:g}):y&&r.jsx(y,{className:at.icono,"aria-hidden":"true"})}),t&&r.jsx("h2",{className:at.titulo,children:t}),r.jsx("p",{className:at.mensaje,children:o}),a&&r.jsx("p",{className:at.descripcion,children:a}),r.jsxs("div",{className:`${at.grupo_botones}${w?` ${at.solo_confirmar}`:""}`,children:[!w&&r.jsx(Ze,{variant:"outline",size:"sm",fullWidth:!0,className:at.boton_modal,onClick:c,children:s}),r.jsx(Ze,{size:"sm",fullWidth:!0,isLoading:f,className:at.boton_modal,style:{"--btn-color":p??"var(--color-tipo)"},onClick:l,children:i})]})]})})});Xn.displayName="ModalAviso";const Nt={overlay:"_overlay_1ywgg_1",container:"_container_1ywgg_47",modal:"_modal_1ywgg_65",modal_closing:"_modal_closing_1ywgg_125",modal_detras:"_modal_detras_1ywgg_143",header:"_header_1ywgg_217",button_back:"_button_back_1ywgg_233",title_container:"_title_container_1ywgg_289",title_icon:"_title_icon_1ywgg_305",title:"_title_1ywgg_289",content:"_content_1ywgg_337",footer:"_footer_1ywgg_351"};function Lf({modals:e,onClose:n}){const[t,o]=h.useState([]),[a,i]=h.useState(!1);h.useEffect(()=>{const f=()=>{i(window.innerWidth<=768)};return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]);const s=f=>{o(d=>[...d,f]),setTimeout(()=>{n(f),o(d=>d.filter(m=>m!==f))},300)};if(e.length===0)return null;const l=e.length-1,c=500,u=24,_=e.length*c+(e.length-1)*u,g=e.length>1?_/2-c/2-l*(c+u):0;return r.jsx("div",{className:Nt.overlay,children:r.jsx("div",{className:Nt.container,style:a?void 0:{transform:`translateX(${g}px)`},children:e.map((f,d)=>{const m=t.includes(f.id),p=d===e.length-1,v=[Nt.modal,m&&Nt.modal_closing,!p&&Nt.modal_detras].filter(Boolean).join(" ");return r.jsxs("div",{className:v,children:[r.jsxs("div",{className:Nt.header,children:[r.jsx("button",{type:"button",className:Nt.button_back,onClick:()=>s(f.id),"aria-label":"Volver",children:r.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:r.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),r.jsxs("div",{className:Nt.title_container,children:[f.titleIcon&&r.jsx("span",{className:Nt.title_icon,children:f.titleIcon}),r.jsx("h2",{className:Nt.title,children:f.title})]})]}),r.jsx("div",{className:Nt.content,children:f.content}),f.footer&&r.jsx("div",{className:Nt.footer,children:f.footer})]},f.id)})})})}const pa=h.createContext(null),ga=()=>{const e=h.useContext(pa);if(!e)throw new Error("useDropdownContext debe usarse dentro de DropdownMenu o ContextMenu");return e},Yn=e=>e.type==="separator"||e.type==="label"?!1:"children"in e&&Array.isArray(e.children)&&e.children.length>0,Gs=e=>e.type==="checkbox",Zs=e=>e.type==="radio",Us=e=>e.type==="separator",Ks=e=>e.type==="label",ze={menu:"_menu_14cye_1",variant_default:"_variant_default_14cye_55",variant_elevated:"_variant_elevated_14cye_65",variant_bordered:"_variant_bordered_14cye_75",variant_glass:"_variant_glass_14cye_89",size_sm:"_size_sm_14cye_103",size_md:"_size_md_14cye_119",size_lg:"_size_lg_14cye_133",item:"_item_14cye_149",disabled:"_disabled_14cye_207",active:"_active_14cye_209",loading:"_loading_14cye_255",spinner_item:"_spinner_item_14cye_267",spinItem:"_spinItem_14cye_1",danger:"_danger_14cye_299",has_submenu:"_has_submenu_14cye_313",submenu_open:"_submenu_open_14cye_321",indicator:"_indicator_14cye_329",start_icon:"_start_icon_14cye_361",content:"_content_14cye_409",label_text:"_label_text_14cye_429",description:"_description_14cye_443",shortcut:"_shortcut_14cye_461",end_icon:"_end_icon_14cye_485",submenu_arrow:"_submenu_arrow_14cye_519",separator:"_separator_14cye_555",label:"_label_14cye_429",context_menu_trigger:"_context_menu_trigger_14cye_663"},Af=()=>r.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:r.jsx("polyline",{points:"20 6 9 17 4 12"})}),Df=()=>r.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:r.jsx("polyline",{points:"9 18 15 12 9 6"})}),Pf=({marcado:e})=>r.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[r.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),e&&r.jsx("circle",{cx:"12",cy:"12",r:"5",fill:"currentColor"})]}),ha=h.forwardRef(({item:e,index:n,activeIndex:t,getItemProps:o},a)=>{const i=ga();if(Us(e))return r.jsx("div",{className:ne(ze.separator,i.classNames?.separator),role:"separator"});if(Ks(e))return r.jsx("div",{className:ne(ze.label,i.classNames?.label),role:"presentation","data-testid":"dropdown-label",children:e.label});const s=n===t,l=Gs(e),c=Zs(e),u=N=>{"isDisabled"in e&&e.isDisabled||(l?e.onCheckedChange?.(!e.isChecked):c&&i.onRadioChange?.(e.value),"onSelect"in e&&e.onSelect&&e.onSelect(N),i.closeOnSelect&&!Yn(e)&&i.cerrarMenu())},_=N=>{u(N)},g=N=>{"isDisabled"in e&&e.isDisabled||(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),u(N))},f=l?e.isChecked:!1,d=c?i.radioValue===e.value:!1,m="label"in e?e.label:void 0,p="description"in e?e.description:void 0,v="shortcut"in e?e.shortcut:void 0,y="startIcon"in e?e.startIcon:void 0,w="endIcon"in e?e.endIcon:void 0,C="isDisabled"in e?e.isDisabled:!1,k="isLoading"in e?e.isLoading:!1,z="isDanger"in e?e.isDanger:!1,A="className"in e?e.className:void 0;return r.jsxs("div",{ref:a,role:l?"menuitemcheckbox":c?"menuitemradio":"menuitem","aria-checked":l?f:c?d:void 0,"aria-disabled":C||k,tabIndex:s?0:-1,className:ne(ze.item,ze[`size_${i.size}`],s&&ze.active,C&&ze.disabled,k&&ze.loading,z&&ze.danger,Yn(e)&&ze.has_submenu,A,i.classNames?.item),onClick:_,onKeyDown:g,...o(),children:[k?r.jsx("span",{className:ze.indicator,children:r.jsx("span",{className:ze.spinner_item})}):(l||c)&&r.jsxs("span",{className:ze.indicator,children:[l&&f&&r.jsx(Af,{}),c&&r.jsx(Pf,{marcado:d})]}),!k&&y&&r.jsx("span",{className:ze.start_icon,children:y}),r.jsxs("span",{className:ze.content,children:[r.jsx("span",{className:ze.label_text,children:m}),p&&r.jsx("span",{className:ze.description,children:p})]}),v&&r.jsx("kbd",{className:ze.shortcut,children:v}),w&&r.jsx("span",{className:ze.end_icon,children:w}),Yn(e)&&r.jsx("span",{className:ze.submenu_arrow,children:r.jsx(Df,{})})]})});ha.displayName="MenuItem";const Tf=()=>r.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:r.jsx("polyline",{points:"9 18 15 12 9 6"})}),Uo=({items:e,activeIndex:n,getItemProps:t,listRef:o})=>r.jsx(r.Fragment,{children:(e??[]).map((a,i)=>Yn(a)?r.jsx(ma,{ref:s=>{o.current[i]=s},item:a,index:i,activeIndex:n,getItemProps:t},a.id):r.jsx(ha,{ref:s=>{o.current[i]=s},item:a,index:i,activeIndex:n,getItemProps:t},a.id))});Uo.displayName="MenuList";const ma=h.forwardRef(({item:e,index:n,activeIndex:t,getItemProps:o},a)=>{const i=ga(),[s,l]=h.useState(!1),c=cn(),u=Ai(),_=h.useRef([]),[g,f]=h.useState(null),{refs:d,floatingStyles:m,context:p,isPositioned:v}=Do({nodeId:u,open:s,onOpenChange:l,placement:"right-start",middleware:[$o({mainAxis:4,alignmentAxis:-4}),ko(),So({padding:8})],whileElementsMounted:yo}),{isMounted:y,styles:w}=Bo(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)"}}),C=Ar(p,{enabled:!e.isDisabled,delay:{open:75},handleClose:os({blockPointerEvents:!0})}),k=Vo(p,{role:"menu"}),z=Ao(p,{bubbles:!0}),A=qr(p,{listRef:_,activeIndex:g,onNavigate:f,nested:!0}),{getReferenceProps:N,getFloatingProps:P,getItemProps:O}=Po([C,k,z,A]);h.useEffect(()=>{if(!c)return;const V=()=>l(!1);return c.events.on("click",V),()=>{c.events.off("click",V)}},[c]);const E=n===t,T=Si([d.setReference,a]);return r.jsxs(Di,{id:u,children:[r.jsxs("div",{ref:T,role:"menuitem","aria-haspopup":"menu","aria-expanded":s,"aria-disabled":e.isDisabled,tabIndex:E?0:-1,className:ne(ze.item,ze[`size_${i.size}`],E&&ze.active,e.isDisabled&&ze.disabled,e.isDanger&&ze.danger,ze.has_submenu,s&&ze.submenu_open,e.className,i.classNames?.item),...N(o()),children:[e.startIcon&&r.jsx("span",{className:ze.start_icon,children:e.startIcon}),r.jsxs("span",{className:ze.content,children:[r.jsx("span",{className:ze.label_text,children:e.label}),e.description&&r.jsx("span",{className:ze.description,children:e.description})]}),e.shortcut&&r.jsx("kbd",{className:ze.shortcut,children:e.shortcut}),r.jsx("span",{className:ze.submenu_arrow,children:r.jsx(Tf,{})})]}),y&&r.jsx(Lo,{root:i.portalContainer,children:r.jsx(Or,{context:p,modal:!1,initialFocus:-1,returnFocus:!1,children:r.jsx("div",{ref:d.setFloating,style:{...m,pointerEvents:"none",zIndex:i.zIndex??"var(--z-dropdown)"},children:r.jsx("div",{className:ne(ze.menu,ze[`variant_${i.variant}`],i.classNames?.menu),style:{...w,pointerEvents:"auto",visibility:v||!s?"visible":"hidden"},...P(),children:r.jsx(Uo,{items:e.children,activeIndex:g,getItemProps:O,listRef:_})})})})})]})});ma.displayName="Submenu";const Xs=h.forwardRef(({children:e,items:n,triggerAction:t="click",placement:o="bottom-start",variant:a="default",size:i="md",isDisabled:s=!1,offset:l=4,minWidth:c="180px",matchTriggerWidth:u=!1,disableAnimation:_=!1,closeOnClickOutside:g=!0,closeOnEscape:f=!0,closeOnSelect:d=!0,className:m,classNames:p,style:v,onOpen:y,onClose:w,onOpenChange:C,onContextMenu:k,isOpen:z,zIndex:A,portalContainer:N,radioValue:P,onRadioChange:O},E)=>{const[T,V]=h.useState(!1),[S,b]=h.useState(null),[x,F]=h.useState(0),I=h.useRef([]),$=h.useRef([]),D=Ai(),B=z!==void 0,X=B?z:T,U=h.useCallback(q=>{s&&q||(B||V(q),C?.(q),q?y?.():w?.())},[s,B,C,y,w]);h.useEffect(()=>{$.current=(n??[]).filter(q=>q.type!=="separator"&&q.type!=="label").map(q=>"label"in q&&typeof q.label=="string"?q.label:"")},[n]);const{refs:L,floatingStyles:j,context:W,isPositioned:ie}=Do({nodeId:D,open:X,onOpenChange:U,placement:o,strategy:"fixed",middleware:[$o(l),ko({fallbackAxisSideDirection:"start",padding:8}),So({padding:8}),u?$i({apply({rects:q,elements:H}){Object.assign(H.floating.style,{minWidth:`${q.reference.width}px`})}}):void 0].filter(Boolean),whileElementsMounted:(q,H,de)=>yo(q,H,de,{animationFrame:!1})}),re=Xi(W,{enabled:!s&&(t==="click"||t==="both"),toggle:!0}),ae=Ar(W,{enabled:!s&&t==="hover",delay:{open:150,close:150},handleClose:os()}),me=Ao(W,{enabled:f||g,escapeKey:f,outsidePress:g}),ee=Vo(W,{role:"menu"}),fe=qr(W,{listRef:I,activeIndex:S,onNavigate:b,loop:!0}),R=es(W,{listRef:$,activeIndex:S,onMatch:b,enabled:X}),{getReferenceProps:se,getFloatingProps:_e,getItemProps:Se}=Po([re,ae,me,ee,fe,R]),{isMounted:ge,styles:le}=Bo(W,{duration:_?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:_?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}});h.useImperativeHandle(E,()=>({open:()=>U(!0),close:()=>U(!1),toggle:()=>U(!X),isOpen:X}),[U,X]);const he=h.useMemo(()=>({radioValue:P,onRadioChange:O,cerrarMenu:()=>U(!1),closeOnSelect:d,size:i,variant:a,disableAnimation:_,classNames:p,portalContainer:N,zIndex:A}),[P,O,U,d,i,a,_,p,N,A]),G=h.isValidElement(e)?e:null,Y=Si([L.setReference,G?.ref||null]);if(!G)return e!=null&&console.error("DropdownMenu: children debe ser un elemento React válido"),null;const ce=t==="contextmenu"||t==="both"?{onContextMenu:q=>{q.preventDefault();const H={x:q.clientX,y:q.clientY};k?.(q,H),U(!1),F(de=>de+1),requestAnimationFrame(()=>{L.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}}}),U(!0)})},onClick:()=>{X&&t==="contextmenu"&&U(!1)}}:{},K=h.cloneElement(e,se({...e.props,...ce,ref:Y,"aria-haspopup":"menu","aria-expanded":X}));return r.jsx(pa.Provider,{value:he,children:r.jsxs(Di,{id:D,children:[K,ge&&r.jsx(Lo,{root:N,children:r.jsx(Or,{context:W,modal:!1,initialFocus:-1,returnFocus:!0,children:r.jsx("div",{ref:L.setFloating,style:{...j,zIndex:A??"var(--z-dropdown)",outline:"none",pointerEvents:"none"},children:r.jsx("div",{role:"menu","aria-orientation":"vertical",className:ne(ze.menu,ze[`variant_${a}`],ze[`size_${i}`],m,p?.menu),style:{...le,minWidth:c,...v,transform:[le.transform,v?.transform].filter(Boolean).join(" "),pointerEvents:"auto",visibility:ie||!X?"visible":"hidden"},..._e(),children:r.jsx(Uo,{items:n,activeIndex:S,getItemProps:Se,listRef:I})},x)})})})]})})});Xs.displayName="DropdownMenuInner";const Ko=h.forwardRef((e,n)=>r.jsx(Wd,{children:r.jsx(Xs,{...e,ref:n})}));Ko.displayName="DropdownMenu";const Ys=h.forwardRef(({isEnabled:e=!0,children:n,...t},o)=>r.jsx(Ko,{...t,ref:o,triggerAction:"contextmenu",isDisabled:!e||t.isDisabled,children:n}));Ys.displayName="ContextMenu";const Ut={group_button:"_group_button_wgdis_1",full_width:"_full_width_wgdis_17",main_button:"_main_button_wgdis_27",dropdown_trigger:"_dropdown_trigger_wgdis_35",first_item:"_first_item_wgdis_45",last_item:"_last_item_wgdis_55",variant_bordered:"_variant_bordered_wgdis_65",variant_ghost:"_variant_ghost_wgdis_67",variant_faded:"_variant_faded_wgdis_69",disabled:"_disabled_wgdis_93",loading:"_loading_wgdis_93",chevron:"_chevron_wgdis_111",chevron_open:"_chevron_open_wgdis_123"},Of=({label:e,onClick:n,items:t,variant:o="solid",color:a="primary",size:i="md",radius:s="md",isLoading:l=!1,isDisabled:c=!1,dropdownIcon:u,className:_,fullWidth:g=!1,...f})=>{const[d,m]=h.useState(!1),p=ne(Ut.group_button,Ut[`variant_${o}`],g&&Ut.full_width,_),v=()=>r.jsx("div",{className:ne(Ut.chevron,d&&Ut.chevron_open),children:r.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:r.jsx("path",{d:"m6 9 6 6 6-6"})})});return r.jsxs("div",{className:p,children:[r.jsx(Ze,{variant:o,color:a,size:i,radius:s,isLoading:l,isDisabled:c,onClick:n,className:ne(Ut.main_button,Ut.first_item),...f,children:e}),t&&r.jsx(Ko,{items:t,triggerAction:"click",onOpenChange:m,placement:"bottom-end",isDisabled:c||l,variant:"default",size:i,matchTriggerWidth:!1,children:r.jsx(Ze,{variant:o,color:a,size:i,radius:s,isDisabled:c||l,isIconOnly:!0,className:ne(Ut.dropdown_trigger,Ut.last_item),"aria-label":"M�s acciones",children:u||v()})})]})},Js=()=>r.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),Qs=()=>r.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:r.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"})}),Rs=()=>r.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:r.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"})}),el=()=>r.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("polyline",{points:"15 18 9 12 15 6"})}),tl=()=>r.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("polyline",{points:"9 18 15 12 9 6"})}),it={overlay:"_overlay_e8cuy_1",backdrop:"_backdrop_e8cuy_25",visible:"_visible_e8cuy_47",layout:"_layout_e8cuy_77",columna_acciones:"_columna_acciones_e8cuy_147",boton_flotante:"_boton_flotante_e8cuy_167",boton_primario:"_boton_primario_e8cuy_241",boton_peligro:"_boton_peligro_e8cuy_251",panel:"_panel_e8cuy_269",encabezado:"_encabezado_e8cuy_297",titulo:"_titulo_e8cuy_315",contenido:"_contenido_e8cuy_331",paginacion:"_paginacion_e8cuy_345",texto_paginacion:"_texto_paginacion_e8cuy_371"},Vf={transparente:{background:"transparent"},sutil:{background:"rgb(0 0 0 / 20%)"},normal:{background:"rgb(0 0 0 / 40%)"},intenso:{background:"rgb(0 0 0 / 60%)"}},Bf=({isOpen:e,onClose:n,onApply:t,onClear:o,title:a="Filtros",backdropVariant:i="sutil",backdropBlur:s=!0,closeOnBackdropClick:l=!0,allowBackdropInteraction:c=!1,getContainer:u,children:_})=>{const[g,f]=h.useState(!1),[d,m]=h.useState(0),p=c||i==="transparente",v=h.useCallback(()=>{g||(f(!0),setTimeout(()=>{n(),f(!1),m(0)},300))},[n,g]);h.useEffect(()=>{e&&f(!1)},[e]),h.useEffect(()=>{if(!e)return;const T=V=>V.key==="Escape"&&v();return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[e,v]);const y=h.useCallback(T=>{l&&T.target===T.currentTarget&&v()},[l,v]),w=h.useCallback(T=>{document.activeElement?.blur(),T?.()},[]),{pages:C,totalPages:k,hasPagination:z}=h.useMemo(()=>{const T=Array.isArray(_)?_:[_];return{pages:T,totalPages:T.length,hasPagination:T.length>1}},[_]),{background:A}=Vf[i],N={background:A,backdropFilter:s?"blur(1px)":"none",pointerEvents:p?"none":"auto"},P=u?{position:"absolute"}:{},O=u?{position:"relative"}:{},E=r.jsxs("div",{className:it.overlay,role:"dialog","aria-modal":"true",style:P,children:[r.jsx("div",{className:`${it.backdrop} ${e&&!g?it.visible:""}`,style:N,onClick:y}),r.jsxs("div",{className:`${it.layout} ${e&&!g?it.visible:""}`,style:O,children:[r.jsxs("aside",{className:it.columna_acciones,children:[r.jsx(_n,{content:"Cerrar",placement:"left",children:r.jsx("button",{type:"button",className:it.boton_flotante,onClick:()=>w(v),"aria-label":"Cerrar panel",children:r.jsx(Js,{})})}),r.jsx(_n,{content:"Aplicar filtros",placement:"left",children:r.jsx("button",{type:"button",className:`${it.boton_flotante} ${it.boton_primario}`,onClick:()=>w(t),children:r.jsx(Qs,{})})}),r.jsx(_n,{content:"Limpiar filtros",placement:"left",children:r.jsx("button",{type:"button",className:`${it.boton_flotante} ${it.boton_peligro}`,onClick:()=>w(o),children:r.jsx(Rs,{})})}),z&&r.jsxs("div",{className:it.paginacion,children:[r.jsx("button",{type:"button",className:it.boton_flotante,style:{width:36,height:36},onClick:()=>m(T=>Math.max(0,T-1)),disabled:d===0,"aria-label":"Página anterior",children:r.jsx(el,{})}),r.jsxs("span",{className:it.texto_paginacion,children:[d+1," / ",k]}),r.jsx("button",{type:"button",className:it.boton_flotante,style:{width:36,height:36},onClick:()=>m(T=>Math.min(k-1,T+1)),disabled:d===k-1,"aria-label":"Página siguiente",children:r.jsx(tl,{})})]})]}),r.jsxs("main",{className:it.panel,children:[r.jsx("header",{className:it.encabezado,children:r.jsx("h2",{className:it.titulo,children:a})}),r.jsx("div",{className:it.contenido,children:r.jsx("div",{style:{animation:"fadeIn 0.3s ease"},children:C[d]},d)})]})]})]});if(u){const T=typeof u=="function"?u():u;if(T&&T instanceof HTMLElement)return Fn.createPortal(E,T)}return E},Q={backdrop:"_backdrop_cyx4s_1",visible:"_visible_cyx4s_41",modal:"_modal_cyx4s_65",encabezado:"_encabezado_cyx4s_147",encabezado_textos:"_encabezado_textos_cyx4s_161",titulo:"_titulo_cyx4s_173",subtitulo:"_subtitulo_cyx4s_187",boton_cerrar:"_boton_cerrar_cyx4s_199",texto_esc:"_texto_esc_cyx4s_249",cuerpo:"_cuerpo_cyx4s_263",zona_carga:"_zona_carga_cyx4s_283",zona_carga_activa:"_zona_carga_activa_cyx4s_315",zona_carga_deshabilitada:"_zona_carga_deshabilitada_cyx4s_351",zona_contenido:"_zona_contenido_cyx4s_363",zona_icono_flotante:"_zona_icono_flotante_cyx4s_379",zona_textos:"_zona_textos_cyx4s_435",zona_titulo:"_zona_titulo_cyx4s_449",zona_separador:"_zona_separador_cyx4s_463",zona_meta:"_zona_meta_cyx4s_497",zona_meta_sep:"_zona_meta_sep_cyx4s_519",zona_meta_tam:"_zona_meta_tam_cyx4s_529",zona_meta_label:"_zona_meta_label_cyx4s_539",tipos_permitidos:"_tipos_permitidos_cyx4s_551",tipo_chip:"_tipo_chip_cyx4s_567",contador:"_contador_cyx4s_589",boton_elegir:"_boton_elegir_cyx4s_609",zona_arrastrando:"_zona_arrastrando_cyx4s_675",drag_icon_wrap:"_drag_icon_wrap_cyx4s_707",drag_ring:"_drag_ring_cyx4s_725",drag_ring_2:"_drag_ring_2_cyx4s_749",drag_ring_3:"_drag_ring_3_cyx4s_757",drag_icono:"_drag_icono_cyx4s_789",drag_textos:"_drag_textos_cyx4s_841",drag_titulo:"_drag_titulo_cyx4s_857",drag_subtitulo:"_drag_subtitulo_cyx4s_871",drag_chips:"_drag_chips_cyx4s_885",drag_chip:"_drag_chip_cyx4s_885",banner_limite:"_banner_limite_cyx4s_953",banner_limite_icono:"_banner_limite_icono_cyx4s_973",banner_limite_cuerpo:"_banner_limite_cuerpo_cyx4s_983",banner_limite_titulo:"_banner_limite_titulo_cyx4s_999",banner_limite_desc:"_banner_limite_desc_cyx4s_1011",banner_limite_pill:"_banner_limite_pill_cyx4s_1021",seccion_lista:"_seccion_lista_cyx4s_1041",cabecera_lista:"_cabecera_lista_cyx4s_1057",cabecera_titulo:"_cabecera_titulo_cyx4s_1071",lista_vacia:"_lista_vacia_cyx4s_1085",ilustracion_vacia:"_ilustracion_vacia_cyx4s_1103",lista_vacia_titulo:"_lista_vacia_titulo_cyx4s_1115",lista_vacia_desc:"_lista_vacia_desc_cyx4s_1127",lista:"_lista_cyx4s_1085",fila:"_fila_cyx4s_1251",fila_eliminada:"_fila_eliminada_cyx4s_1289",fila_subiendo:"_fila_subiendo_cyx4s_1289",fila_entrando:"_fila_entrando_cyx4s_1299",fila_saliendo:"_fila_saliendo_cyx4s_1307",fila_nombre:"_fila_nombre_cyx4s_1341",fila_restaurando:"_fila_restaurando_cyx4s_1401",fila_icono:"_fila_icono_cyx4s_1409",fila_error:"_fila_error_cyx4s_1421",fila_aviso:"_fila_aviso_cyx4s_1429",fila_cuerpo:"_fila_cuerpo_cyx4s_1437",fila_error_texto:"_fila_error_texto_cyx4s_1453",estado:"_estado_cyx4s_1479",estado_guardado:"_estado_guardado_cyx4s_1495",estado_nuevo:"_estado_nuevo_cyx4s_1505",estado_subiendo:"_estado_subiendo_cyx4s_1515",estado_eliminado:"_estado_eliminado_cyx4s_1537",fila_acciones:"_fila_acciones_cyx4s_1557",btn_eliminar:"_btn_eliminar_cyx4s_1569",btn_restaurar:"_btn_restaurar_cyx4s_1631",btn_reintentar:"_btn_reintentar_cyx4s_1699",spinner:"_spinner_cyx4s_1743",pie:"_pie_cyx4s_1765",pie_info:"_pie_info_cyx4s_1783",btn_pie:"_btn_pie_cyx4s_1795",input_archivo:"_input_archivo_cyx4s_1803"},jf={jpg:"#10b981",jpeg:"#10b981",png:"#6366f1",webp:"#06b6d4",gif:"#ec4899",avif:"#8b5cf6",pdf:"#ef4444",xls:"#22c55e",xlsx:"#16a34a",csv:"#4ade80",rar:"#f97316",zip:"#f59e0b","7z":"#fb923c",tar:"#ea580c",doc:"#3b82f6",docx:"#2563eb",txt:"#64748b",md:"#475569",mp4:"#a855f7",mov:"#9333ea",avi:"#7e22ce",mp3:"#ec4899",wav:"#db2777",psd:"#0ea5e9",ai:"#f97316",svg:"#8b5cf6"};function qf(e){const n=e.split(".").pop()?.toLowerCase()??"";return jf[n]??"#94a3b8"}function Hf(e){const n=e.split(".").pop()?.toLowerCase()??"";return n.length>4?n.slice(0,3).toUpperCase():n.toUpperCase()||"FILE"}function Jn({nombre:e,size:n=36}){const t=qf(e),o=Hf(e),a=Math.round(n*44/36);return r.jsxs("svg",{width:n,height:a,viewBox:"0 0 36 44",fill:"none","aria-hidden":"true",children:[r.jsx("rect",{x:"4",y:"5",width:"29",height:"37",rx:"5",fill:"black",fillOpacity:"0.06"}),r.jsx("path",{d:"M3 5C3 3.343 4.343 2 6 2H23L33 12V39C33 40.657 31.657 42 30 42H6C4.343 42 3 40.657 3 39V5Z",fill:"white"}),r.jsx("path",{d:"M3 5C3 3.343 4.343 2 6 2H23L33 12V39C33 40.657 31.657 42 30 42H6C4.343 42 3 40.657 3 39V5Z",stroke:"#E2E8F0",strokeWidth:"0.8",fill:"none"}),r.jsx("path",{d:"M23 2L33 12H26C24.343 12 23 10.657 23 9V2Z",fill:"#EEF2FF"}),r.jsx("path",{d:"M23 2L33 12",stroke:"#E2E8F0",strokeWidth:"0.8",fill:"none"}),r.jsx("rect",{x:"8",y:"17",width:"18",height:"1.5",rx:"0.75",fill:t,fillOpacity:"0.2"}),r.jsx("rect",{x:"8",y:"21",width:"14",height:"1.5",rx:"0.75",fill:"#CBD5E1",fillOpacity:"0.6"}),r.jsx("rect",{x:"8",y:"25",width:"16",height:"1.5",rx:"0.75",fill:"#CBD5E1",fillOpacity:"0.6"}),r.jsx("path",{d:"M3 32H33V39C33 40.657 31.657 42 30 42H6C4.343 42 3 40.657 3 39V32Z",fill:t}),r.jsx("text",{x:"18",y:"39.5",textAnchor:"middle",fill:"white",fontSize:"8",fontWeight:"700",fontFamily:"system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif",letterSpacing:"0.4",children:o})]})}function nl({size:e=24,className:n}){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",className:n,children:r.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",children:[r.jsx("path",{strokeLinejoin:"round",d:"M2.75 12H6a2 2 0 0 1 2 2a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2a2 2 0 0 1 2-2h3.25"}),r.jsx("path",{d:"M21.25 10.375v4.875a6 6 0 0 1-6 6h-6.5a6 6 0 0 1-6-6v-6.5a6 6 0 0 1 6-6h4.875"}),r.jsx("path",{strokeMiterlimit:"10",d:"M18.957 2.75v5"}),r.jsx("path",{strokeLinejoin:"round",d:"m21.25 4.855l-1.967-1.967a.46.46 0 0 0-.652 0l-1.967 1.967"})]})})}function Wf({size:e=18,className:n}){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",className:n,children:r.jsx("path",{fill:"currentColor",d:"M11 16V7.85l-2.6 2.6L7 9l5-5l5 5l-1.4 1.45l-2.6-2.6V16zm-5 4q-.825 0-1.412-.587T4 18v-3h2v3h12v-3h2v3q0 .825-.587 1.413T18 20z"})})}function ol({size:e=18,className:n}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:n,"aria-hidden":"true",children:[r.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.08"}),r.jsx("path",{d:"M15 9l-6 6M9 9l6 6",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round"})]})}function Gf({size:e=20,className:n}){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",className:n,children:[r.jsx("path",{fill:"currentColor",d:"M3 6.524c0-.395.327-.714.73-.714h4.788c.006-.842.098-1.995.932-2.793A3.68 3.68 0 0 1 12 2a3.68 3.68 0 0 1 2.55 1.017c.834.798.926 1.951.932 2.793h4.788c.403 0 .73.32.73.714a.72.72 0 0 1-.73.714H3.73A.72.72 0 0 1 3 6.524"}),r.jsx("path",{fill:"currentColor",d:"M11.596 22h.808c2.783 0 4.174 0 5.08-.886c.904-.886.996-2.339 1.181-5.245l.267-4.188c.1-1.577.15-2.366-.303-2.865c-.454-.5-1.22-.5-2.753-.5H8.124c-1.533 0-2.3 0-2.753.5s-.404 1.288-.303 2.865l.267 4.188c.185 2.906.277 4.36 1.182 5.245c.905.886 2.296.886 5.079.886",opacity:".5"}),r.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.425 11.482c.413-.044.78.273.821.707l.5 5.263c.041.433-.26.82-.671.864c-.412.043-.78-.273-.821-.707l-.5-5.263c-.041-.434.26-.821.671-.864m5.15 0c.412.043.713.43.671.864l-.5 5.263c-.04.434-.408.75-.82.707c-.413-.044-.713-.43-.672-.864l.5-5.264c.041-.433.409-.75.82-.707",clipRule:"evenodd"})]})}function Zf({size:e=16,className:n}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:n,"aria-hidden":"true",children:[r.jsx("path",{d:"M12 21a9 9 0 1 0-9-9",fill:"currentColor",fillOpacity:"0.1",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"}),r.jsx("path",{d:"M3 12V7m0 5h5",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Uf({size:e=16,className:n}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:n,"aria-hidden":"true",children:[r.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.12"}),r.jsx("path",{d:"M7.5 12.5l3 3 6-6",stroke:"currentColor",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Kf({size:e=20,className:n}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:n,"aria-hidden":"true",children:[r.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.16",stroke:"currentColor",strokeWidth:"1.7"}),r.jsx("path",{d:"M12 8v5",stroke:"currentColor",strokeWidth:"2.1",strokeLinecap:"round"}),r.jsx("circle",{cx:"12",cy:"16.5",r:"1",fill:"currentColor"})]})}function rl({size:e=20,className:n}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:n,"aria-hidden":"true",children:[r.jsx("path",{d:"M10.268 4a2 2 0 0 1 3.464 0l7.536 13A2 2 0 0 1 19.536 20H4.464a2 2 0 0 1-1.732-3L10.268 4z",fill:"currentColor",fillOpacity:"0.14",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"}),r.jsx("path",{d:"M12 9v5",stroke:"currentColor",strokeWidth:"2.1",strokeLinecap:"round"}),r.jsx("circle",{cx:"12",cy:"17",r:"1",fill:"currentColor"})]})}function Xf({size:e=18,className:n}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:n,"aria-hidden":"true",children:[r.jsx("path",{d:"M2 12C4 7 7.5 4.5 12 4.5S20 7 22 12c-2 5-5.5 7.5-10 7.5S4 17 2 12z",fill:"currentColor",fillOpacity:"0.1",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),r.jsx("circle",{cx:"12",cy:"12",r:"2.8",fill:"currentColor",fillOpacity:"0.65"}),r.jsx("circle",{cx:"12",cy:"12",r:"1.15",fill:"currentColor"})]})}function al({size:e=18,className:n}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:n,"aria-hidden":"true",children:[r.jsx("path",{d:"M4 17v1a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-1",fill:"currentColor",fillOpacity:"0.1",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),r.jsx("path",{d:"M12 4v11m0 0-3-3m3 3 3-3",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round"})]})}function il({className:e}){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 500 500",className:e,"aria-hidden":"true",children:[r.jsxs("g",{children:[r.jsx("rect",{y:"382.4",width:"500",height:"0.25",style:{fill:"#e6e6e6"}}),r.jsx("rect",{x:"449.63",y:"391.22",width:"18.77",height:"0.25",style:{fill:"#e6e6e6"}}),r.jsx("rect",{x:"373.07",y:"398.08",width:"8.69",height:"0.25",style:{fill:"#e6e6e6"}}),r.jsx("rect",{x:"279.96",y:"394.63",width:"19.36",height:"0.25",style:{fill:"#e6e6e6"}}),r.jsx("rect",{x:"80.93",y:"394.5",width:"43.19",height:"0.25",style:{fill:"#e6e6e6"}}),r.jsx("rect",{x:"65.7",y:"394.5",width:"6.33",height:"0.25",style:{fill:"#e6e6e6"}}),r.jsx("rect",{x:"189.3",y:"388.58",width:"93.68",height:"0.25",style:{fill:"#e6e6e6"}}),r.jsx("rect",{x:"58.71",y:"73.68",width:"202.25",height:"144.13",style:{fill:"#fafafa"}}),r.jsx("rect",{x:"60.46",y:"73.68",width:"204.24",height:"144.13",style:{fill:"#f5f5f5"}}),r.jsx("rect",{x:"96.4",y:"48.86",width:"132.36",height:"193.76",transform:"translate(308.32 -16.84) rotate(90)",style:{fill:"#fafafa"}}),r.jsx("polygon",{points:"100.98 211.92 131.72 79.56 172.02 79.56 141.28 211.92 100.98 211.92",style:{fill:"#fff"}}),r.jsx("polygon",{points:"147.8 211.92 178.55 79.56 196.75 79.56 166 211.92 147.8 211.92",style:{fill:"#fff"}}),r.jsx("rect",{x:"192.95",y:"145.41",width:"132.36",height:"0.67",transform:"translate(404.87 -113.39) rotate(90)",style:{fill:"#fafafa"}}),r.jsx("path",{d:"M54.78,73.44v57.12H69.89S97,112.85,103.21,76.42a6.06,6.06,0,0,0-6-7.09H58.89A4.11,4.11,0,0,0,54.78,73.44Z",style:{fill:"#e0e0e0"}}),r.jsx("path",{d:"M54.78,235.44V135.17H69.89s30.67,59.05,34.22,100.27Z",style:{fill:"#e0e0e0"}}),r.jsx("rect",{x:"53.82",y:"130.56",width:"17.14",height:"4.61",rx:"1.51",style:{fill:"#f5f5f5"}}),r.jsx("path",{d:"M269,73.44v57.12H253.86s-27.15-17.71-33.32-54.14a6.07,6.07,0,0,1,6-7.09h38.36A4.12,4.12,0,0,1,269,73.44Z",style:{fill:"#e0e0e0"}}),r.jsx("path",{d:"M269,235.44V135.17H253.86s-30.66,59.05-34.22,100.27Z",style:{fill:"#e0e0e0"}}),r.jsx("rect",{x:"252.8",y:"130.56",width:"17.14",height:"4.61",rx:"1.51",transform:"translate(522.73 265.72) rotate(180)",style:{fill:"#f5f5f5"}}),r.jsx("rect",{x:"231.2",y:"253.66",width:"33.23",height:"128.74",style:{fill:"#fafafa"}}),r.jsx("polygon",{points:"255.56 382.4 264.43 382.4 264.43 367.53 246.26 367.53 255.56 382.4",style:{fill:"#f4f8ff"}}),r.jsx("rect",{x:"72.22",y:"253.66",width:"33.23",height:"128.74",style:{fill:"#e0e0e0"}}),r.jsx("rect",{x:"97.71",y:"253.66",width:"166.72",height:"123.62",style:{fill:"#fafafa"}}),r.jsx("path",{d:"M147.8,231.8c0,12,11.56,21.86,25.7,21.86h12.76c14.13,0,25.69-9.84,25.69-21.86Z",style:{fill:"#ebebeb"}}),r.jsx("path",{d:"M140.4,204.33h24s-4.17,11-4.17,17.48,18.26,31.85-7.83,31.85-7.83-25.38-7.83-31.85S140.4,204.33,140.4,204.33Z",style:{fill:"#e0e0e0"}}),r.jsx("rect",{x:"104.59",y:"261.19",width:"152.96",height:"31.17",style:{fill:"#ebebeb"}}),r.jsx("polygon",{points:"106.58 382.4 97.71 382.4 97.71 367.53 115.89 367.53 106.58 382.4",style:{fill:"#fafafa"}}),r.jsx("path",{d:"M176.37,276.77a4.7,4.7,0,1,0,4.7-4.7A4.7,4.7,0,0,0,176.37,276.77Z",style:{fill:"#fafafa"}}),r.jsx("rect",{x:"104.59",y:"299.89",width:"152.96",height:"31.17",style:{fill:"#ebebeb"}}),r.jsx("path",{d:"M176.37,315.47a4.7,4.7,0,1,0,4.7-4.7A4.7,4.7,0,0,0,176.37,315.47Z",style:{fill:"#fafafa"}}),r.jsx("rect",{x:"104.59",y:"338.58",width:"152.96",height:"31.17",style:{fill:"#ebebeb"}}),r.jsx("circle",{cx:"181.07",cy:"354.17",r:"4.7",style:{fill:"#fafafa"}}),r.jsx("rect",{x:"295.65",y:"71.94",width:"74.23",height:"52.84",style:{fill:"#e0e0e0"}}),r.jsx("rect",{x:"299.87",y:"71.94",width:"76.07",height:"52.84",style:{fill:"#f5f5f5"}}),r.jsx("rect",{x:"316.34",y:"65.17",width:"43.14",height:"66.37",transform:"translate(436.26 -239.55) rotate(90)",style:{fill:"#fff"}}),r.jsx("rect",{x:"328.9",y:"76.85",width:"18.01",height:"43.01",transform:"translate(436.26 -239.55) rotate(90)",style:{fill:"#f5f5f5"}}),r.jsx("rect",{x:"384.92",y:"98.36",width:"45.18",height:"47.38",style:{fill:"#e0e0e0"}}),r.jsx("rect",{x:"389.15",y:"98.36",width:"47.03",height:"47.38",style:{fill:"#f5f5f5"}}),r.jsx("rect",{x:"393.82",y:"103.38",width:"37.68",height:"37.33",transform:"translate(534.71 -290.61) rotate(90)",style:{fill:"#fff"}}),r.jsx("path",{d:"M405.68,122.05h0a6.28,6.28,0,0,1,6.27-6.28h1.42a6.28,6.28,0,0,1,6.27,6.28h0a6.27,6.27,0,0,1-6.27,6.27H412A6.27,6.27,0,0,1,405.68,122.05Z",style:{fill:"#f5f5f5"}}),r.jsx("polygon",{points:"500 161.85 380.7 161.85 359.01 161.85 359.01 189.42 337.32 189.42 337.32 216.99 315.63 216.99 315.63 244.56 293.94 244.56 293.94 272.13 272.25 272.13 272.25 299.69 250.56 299.69 250.56 327.26 228.87 327.26 228.87 354.83 207.18 354.83 207.18 382.4 228.87 382.4 500 382.4 500 161.85",style:{fill:"#fafafa"}}),r.jsx("rect",{x:"204.95",y:"354.83",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),r.jsx("rect",{x:"226.64",y:"327.26",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),r.jsx("rect",{x:"248.33",y:"299.69",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),r.jsx("rect",{x:"270.02",y:"272.12",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),r.jsx("rect",{x:"291.71",y:"244.56",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),r.jsx("rect",{x:"313.4",y:"216.99",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),r.jsx("rect",{x:"335.09",y:"189.42",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),r.jsx("rect",{x:"356.78",y:"161.85",width:"123.63",height:"8.27",style:{fill:"#ebebeb"}}),r.jsx("polygon",{points:"478.31 161.85 478.31 189.42 456.62 189.42 456.62 216.99 434.93 216.99 434.93 244.56 413.24 244.56 413.24 272.13 391.55 272.13 391.55 299.69 369.86 299.69 369.86 327.26 348.17 327.26 348.17 354.83 326.48 354.83 326.48 382.4 348.17 382.4 500 382.4 500 189.42 500 161.85 478.31 161.85",style:{fill:"#fff"}})]}),r.jsx("ellipse",{cx:"250",cy:"416.24",rx:"193.89",ry:"11.32",style:{fill:"#f5f5f5"}}),r.jsxs("g",{children:[r.jsx("path",{d:"M365.15,162c1.4,4.69,8.62,13.47,9.19,19.86s-11.74,16.61-11.74,16.61-9.2-30.76-3.44-34.35S365.15,162,365.15,162Z",style:{fill:"#263238"}}),r.jsx("path",{d:"M339.87,195.23c-2.18,1.82-4.32,3.35-6.55,4.92s-4.53,3-6.87,4.34a77.83,77.83,0,0,1-7.25,3.79c-1.26.57-2.51,1.13-3.81,1.62-.64.26-1.29.51-1.95.73l-2,.7a13.24,13.24,0,0,1-5.26.38,30.07,30.07,0,0,1-4.36-.84,57.61,57.61,0,0,1-7.81-2.78,104.07,104.07,0,0,1-14.19-7.55l1.87-3.48c2.36,1,4.78,2,7.18,2.87s4.82,1.79,7.24,2.54a60.74,60.74,0,0,0,7.2,1.88,23.5,23.5,0,0,0,3.39.41,7.07,7.07,0,0,0,2.52-.26,64.62,64.62,0,0,0,6.68-3c1.11-.58,2.21-1.17,3.29-1.81s2.18-1.26,3.25-1.92c2.15-1.33,4.25-2.74,6.33-4.19s4.15-3,6-4.47Z",style:{fill:"#e58a7b"}}),r.jsx("path",{d:"M345.15,184.58c-2.48-1.94-12.74,4.41-15.85,7.06l2.27,13.73s14.75-6.18,15.63-10.4C348.13,190.56,347,186.06,345.15,184.58Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.8}}),r.jsx("polygon",{points:"385.58 406.47 377.79 407.05 374.94 389.12 382.73 388.54 385.58 406.47",style:{fill:"#e58a7b"}}),r.jsx("polygon",{points:"440.68 381.41 434.07 385.57 422.3 371.61 428.91 367.44 440.68 381.41",style:{fill:"#e58a7b"}}),r.jsx("polygon",{points:"374.94 389.12 376.52 399.08 384.2 397.79 382.74 388.55 374.94 389.12",style:{fill:"#cf6f64"}}),r.jsx("polygon",{points:"428.92 367.45 422.3 371.61 427.18 377.39 433.94 373.4 428.92 367.45",style:{fill:"#cf6f64"}}),r.jsx("path",{d:"M349,232.2s-.11,61.82,4.94,85.1c5.26,24.22,20.73,79.32,20.73,79.32l11.22-1.45s-8.77-55.66-12.51-79.73c-4.07-26.23-1.57-87.68-1.57-87.68Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.7}}),r.jsx("path",{d:"M371.11,255.16l-5.5-5.48c.21,23.75,1.54,35.48,6.11,48.26C371,284.43,370.94,268.45,371.11,255.16Z",style:{opacity:.5}}),r.jsx("path",{d:"M356.74,230.6s16.77,51.09,25.09,80.52c8.78,31.05,42.44,65.39,42.44,65.39l9.66-5.58s-23-32.6-31.46-61.57c-17.2-58.81-10.13-71.27-22.82-83.23Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.7}}),r.jsx("path",{d:"M343.56,147.09c4.46,1.49,8.51,12.56,8.68,16.92s-12.92,10.37-12.92,10.37-5.77-14-4.16-23C335.86,147.47,343.56,147.09,343.56,147.09Z",style:{fill:"#263238"}}),r.jsx("path",{d:"M282.35,197.43l-5.29-5.76-1.73,7.22s3.76,3.32,6.8,2.18Z",style:{fill:"#e58a7b"}}),r.jsx("polygon",{points:"271.7 190.02 268 192.96 275.33 198.89 277.06 191.67 271.7 190.02",style:{fill:"#e58a7b"}}),r.jsx("path",{d:"M432,384.08l6.18-6.23a.63.63,0,0,1,.82-.06l5.63,4.18a1.25,1.25,0,0,1,.11,1.87c-2.2,2.13-3.36,3.05-6.08,5.79-1.67,1.69-3.94,4.32-6.25,6.65s-4.74.16-4-1c3.37-5.27,2.77-7.24,3-9.92A2,2,0,0,1,432,384.08Z",style:{fill:"#263238"}}),r.jsx("path",{d:"M377.27,405.93h8.78a.66.66,0,0,1,.65.54l1.38,6.94a1.18,1.18,0,0,1-1.17,1.39c-3.07-.05-4.55-.23-8.41-.23-2.37,0-7.27.24-10.55.24s-3.63-3.24-2.28-3.53c6-1.32,8.35-3.13,10.32-4.87A2,2,0,0,1,377.27,405.93Z",style:{fill:"#263238"}}),r.jsx("path",{d:"M349.81,161.79c3.41,2.85,8.36,7,14.19,2.15,5-4.18,8.5-15.15-.47-15.55C358.84,148.18,349.81,161.79,349.81,161.79Z",style:{fill:"#263238"}}),r.jsx("path",{d:"M358.05,163.74c0,4.72.73,13.23,4.5,15.65,0,0-.34,4.86-8.8,6.5-9.29,1.81-5.34-3.75-5.34-3.75,4.84-2.2,4-5.94,2.4-9.3Z",style:{fill:"#e58a7b"}}),r.jsx("path",{d:"M355.1,167.45l-4.28,5.39a15.19,15.19,0,0,1,.92,2.42c1.88-.66,4.13-3.3,3.94-5.37A6.83,6.83,0,0,0,355.1,167.45Z",style:{fill:"#cf6f64"}}),r.jsx("path",{d:"M358.5,152.9c1,7.69,1.61,10.92-1.47,15.57-4.63,7-14.29,6.55-17.58-.68-3-6.51-4.12-18,2.72-22.45A10.57,10.57,0,0,1,358.5,152.9Z",style:{fill:"#e58a7b"}}),r.jsx("path",{d:"M345.14,139.43c-5.2,3.69,5.23,4.78,5.24,10.13,0,2.21,3.63,9.22,8.79,8.82l5-8.88C369.43,141,357,131,345.14,139.43Z",style:{fill:"#263238"}}),r.jsx("path",{d:"M345.14,139.43c-9.15-.48-13.14,6.8-12.09,13.34a59.6,59.6,0,0,1,19.54-1.55C365.13,152.5,345.14,139.43,345.14,139.43Z",style:{fill:"#263238"}}),r.jsx("path",{d:"M361,159.53a5.65,5.65,0,0,1-1.31,4.12c-1.29,1.51-3,.62-3.6-1.17-.51-1.62-.45-4.35,1.29-5.21A2.55,2.55,0,0,1,361,159.53Z",style:{fill:"#e58a7b"}}),r.jsx("path",{d:"M347.39,157.27c.12.62-.11,1.18-.51,1.26s-.83-.36-.95-1,.11-1.19.51-1.27S347.27,156.65,347.39,157.27Z",style:{fill:"#263238"}}),r.jsx("path",{d:"M340.4,158.63c.12.62-.11,1.19-.51,1.27s-.83-.36-.95-1,.11-1.19.51-1.26S340.28,158,340.4,158.63Z",style:{fill:"#263238"}}),r.jsx("path",{d:"M342.46,159.34a17.1,17.1,0,0,1-1.44,4.37,2.71,2.71,0,0,0,2.29,0Z",style:{fill:"#df5753"}}),r.jsx("path",{d:"M345.92,165.71a.18.18,0,0,1-.18-.15.18.18,0,0,1,.15-.21,5,5,0,0,0,3.62-2.7.18.18,0,1,1,.34.14,5.27,5.27,0,0,1-3.89,2.92Z",style:{fill:"#263238"}}),r.jsx("path",{d:"M353.5,192.54c-16.73,3.73-11.56-6.39-10.56-8.62l.42-.16c2-.73,2.4-.84,5.06-1.62a100.71,100.71,0,0,1,14.14-2.75l1-.14c1-.13,1.91-.23,2.83-.31.62-.07,1.24-.11,1.83-.15l2-.12h0C370.56,180.23,371.39,188.57,353.5,192.54Z",style:{fill:"#e58a7b"}}),r.jsx("path",{d:"M379.76,224.21l1.95,2.52c.15.19-.06.46-.42.53l-32.66,6.36c-.28.06-.54,0-.59-.21l-.83-2.73c0-.19.16-.4.46-.46l31.54-6.14A.57.57,0,0,1,379.76,224.21Z",style:{fill:"#26395a"}}),r.jsx("path",{d:"M376.21,228.56l.85-.16c.17,0,.28-.14.25-.25l-1.1-3.54c0-.11-.2-.16-.37-.13l-.84.16c-.17,0-.28.15-.25.25l1.1,3.55C375.88,228.54,376.05,228.6,376.21,228.56Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M357.08,240.36l-6.51-2.42,1,6.19s4.72,1.7,7.13-.48Z",style:{fill:"#e58a7b"}}),r.jsx("polygon",{points:"344.37 239.58 342.82 243.64 351.57 244.13 350.57 237.94 344.37 239.58",style:{fill:"#e58a7b"}}),r.jsx("path",{d:"M351.06,233.46l.85-.16c.16,0,.28-.14.24-.25l-1.1-3.54c0-.11-.19-.16-.36-.13l-.85.16c-.17,0-.28.15-.24.25l1.1,3.55C350.73,233.44,350.89,233.5,351.06,233.46Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M363.64,231l.84-.16c.17,0,.28-.14.25-.25l-1.1-3.54c0-.11-.2-.16-.37-.13l-.84.16c-.17,0-.28.15-.25.25l1.1,3.55A.32.32,0,0,0,363.64,231Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M355.27,165.13c-2,3.31,5.25,4.84,9.54,1.45,3.43-2.72,2.62-9-.32-10.46S355.27,165.13,355.27,165.13Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.4}}),r.jsx("path",{d:"M379.66,226.13l-31.14,6.07c-16.09-43.57-12.59-45-12.59-45a62.53,62.53,0,0,1,7-3.3l.42-.16c2-.73,2.4-.84,5.06-1.62,4.58-1.09,8.85-2,14.14-2.75l1-.14c1-.12,1.91-.22,2.83-.31.62-.07,1.24-.11,1.83-.15l2-.11c3.42-.17,5.87-.12,5.87-.12C375.13,205.75,376.67,213.56,379.66,226.13Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.8}}),r.jsx("path",{d:"M377.09,194.31l-4.8,2.86L377.83,218C376.62,211.69,377.16,204.76,377.09,194.31Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.27,mixBlendMode:"multiply"}}),r.jsx("polygon",{points:"387.9 395.13 372.62 397.11 371.62 392.85 387.53 389.48 387.9 395.13",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("polygon",{points:"434.74 370.59 423.47 377.1 419.67 373.85 432 365.51 434.74 370.59",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M381.85,189.13c.54,2.78.85,5.4,1.15,8.11s.41,5.39.49,8.1a80.09,80.09,0,0,1-.18,8.19c-.11,1.37-.23,2.74-.42,4.12-.08.68-.17,1.37-.3,2.06l-.37,2.12a13.32,13.32,0,0,1-2.21,4.79,29.67,29.67,0,0,1-2.84,3.41,56.66,56.66,0,0,1-6.2,5.5,103.64,103.64,0,0,1-13.46,8.79L355.37,241c2-1.59,4-3.23,6-4.9s3.9-3.36,5.73-5.12a62.64,62.64,0,0,0,5.11-5.39,23.76,23.76,0,0,0,2-2.78,7,7,0,0,0,1-2.33,66.19,66.19,0,0,0,.57-7.32c0-1.25,0-2.5,0-3.75s-.05-2.52-.11-3.78c-.12-2.52-.35-5-.62-7.56s-.62-5.09-1-7.46Z",style:{fill:"#e58a7b"}}),r.jsx("path",{d:"M380.64,180.63c4.27,3.46,3.25,13.74,3.25,13.74l-14.4,4.74s.66-11.85,1.38-16.11C371.71,177.93,376.43,177.22,380.64,180.63Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.8}}),r.jsx("path",{d:"M429.68,387.71a1.06,1.06,0,0,1-.86-.48.63.63,0,0,1-.11-.62c.35-.94,3.11-1.54,3.42-1.61a.19.19,0,0,1,.19.08.17.17,0,0,1,0,.2c-.54.89-1.6,2.38-2.59,2.43Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M431.32,385.46c-1,0-2.25-.25-2.62-.79a.65.65,0,0,1,.07-.81,1,1,0,0,1,.73-.38h.08c1.12,0,2.66,1.51,2.72,1.57a.18.18,0,0,1,.05.18.19.19,0,0,1-.13.13A3.61,3.61,0,0,1,431.32,385.46Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M374.4,407.3a3,3,0,0,1-1.91-.48,1,1,0,0,1-.38-.89.58.58,0,0,1,.28-.5c.92-.54,4.14,1.06,4.5,1.24a.19.19,0,0,1,.1.19.19.19,0,0,1-.14.16A13.33,13.33,0,0,1,374.4,407.3Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M376.81,407h-.07c-1-.43-2.93-2.13-2.79-3,0-.2.18-.46.68-.51h.15c1.74,0,2.19,3.18,2.21,3.32a.2.2,0,0,1-.07.18A.2.2,0,0,1,376.81,407Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M360.08,175.42c.71-.27,1.6,2.23,1.38,2.55-.51.73-9.85,3.28-10.27,1.85a6.24,6.24,0,0,1,.35-2.28C351.81,177.06,353.88,177.94,360.08,175.42Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M358.5,175.48c.36-.83,1.39-2.16,2.29-1.4s1.28,2.4.69,2.67S357.88,176.87,358.5,175.48Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M360.41,175.91c.62-.66,2-1.57,2.63-.55s.4,2.69-.24,2.74S359.36,177,360.41,175.91Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M360.75,175.76a2.77,2.77,0,0,1,1.39-2.67c1.14-.74,2.25-1.22,2.69-2a5.52,5.52,0,0,1,.11,2.24c-.23,1.07-3.78,1.89-3.54,2.82Z",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M360.6,175.71a2.77,2.77,0,0,1-.28-3c.54-1.24,1.22-2.24,1.18-3.12a5.57,5.57,0,0,1,1.31,1.82c.38,1-2.15,3.63-1.44,4.29Z",style:{fill:"var(--brand-primary, #407BFF)"}})]}),r.jsxs("g",{children:[r.jsx("path",{d:"M190.41,223.53h0A11,11,0,0,0,179.69,215h-80a11,11,0,0,0-11,11V403.82a11,11,0,0,0,11,11h254a11,11,0,0,0,11-11V254.45a11,11,0,0,0-11-11H215.44A25.68,25.68,0,0,1,190.41,223.53Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.6}}),r.jsx("path",{d:"M162.17,168.15l7.13,23.09a11.61,11.61,0,0,0,14.51,7.66l23.08-7.13Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.22}}),r.jsx("path",{d:"M162.17,168.15l-82.5,25.49A11.59,11.59,0,0,0,72,208.14l47.1,152.48a11.6,11.6,0,0,0,14.51,7.66L239.2,335.66a11.59,11.59,0,0,0,7.66-14.5l-40-129.39Z",style:{fill:"#fff",opacity:.8}}),r.jsx("g",{style:{opacity:.28},children:r.jsx("path",{d:"M206.56,329l-68.64,21.2a5.08,5.08,0,0,1-6.34-3.34h0a5.08,5.08,0,0,1,3.35-6.33l68.64-21.21a5.08,5.08,0,0,1,6.34,3.35h0A5.08,5.08,0,0,1,206.56,329Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.28},children:r.jsx("path",{d:"M132.69,204.58l-36.3,11.21a5.09,5.09,0,0,1-6.34-3.34h0a5.09,5.09,0,0,1,3.35-6.34l36.3-11.21a5.07,5.07,0,0,1,6.34,3.34h0A5.09,5.09,0,0,1,132.69,204.58Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.28},children:r.jsx("path",{d:"M162.31,216.47l-60,18.53A5.08,5.08,0,0,1,96,231.65h0a5.07,5.07,0,0,1,3.34-6.33l60-18.53a5.08,5.08,0,0,1,6.34,3.34h0A5.1,5.1,0,0,1,162.31,216.47Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.28},children:r.jsx("path",{d:"M195.81,227.16l-87.56,27a5.07,5.07,0,0,1-6.33-3.34h0a5.09,5.09,0,0,1,3.34-6.34l87.56-27a5.08,5.08,0,0,1,6.33,3.34h0A5.08,5.08,0,0,1,195.81,227.16Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.28},children:r.jsx("path",{d:"M201.74,246.36l-50.9,15.73a5.08,5.08,0,0,1-6.33-3.35h0a5.08,5.08,0,0,1,3.34-6.33l50.9-15.73a5.1,5.1,0,0,1,6.34,3.35h0A5.08,5.08,0,0,1,201.74,246.36Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.28},children:r.jsx("path",{d:"M127.5,269.3l-13.31,4.11a5.08,5.08,0,0,1-6.34-3.34h0a5.08,5.08,0,0,1,3.35-6.34l13.31-4.11a5.09,5.09,0,0,1,6.34,3.34h0A5.1,5.1,0,0,1,127.5,269.3Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.28},children:r.jsx("path",{d:"M207.68,265.57l-87.56,27.05a5.08,5.08,0,0,1-6.33-3.35h0a5.07,5.07,0,0,1,3.34-6.33l87.56-27.05a5.08,5.08,0,0,1,6.33,3.34h0A5.08,5.08,0,0,1,207.68,265.57Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.28},children:r.jsx("path",{d:"M179.82,295.21l-53.77,16.61a5.08,5.08,0,0,1-6.33-3.34h0a5.09,5.09,0,0,1,3.34-6.34l53.77-16.61a5.09,5.09,0,0,1,6.34,3.35h0A5.07,5.07,0,0,1,179.82,295.21Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.28},children:r.jsx("path",{d:"M213.61,284.78l-14.35,4.43a5.09,5.09,0,0,1-6.34-3.35h0a5.08,5.08,0,0,1,3.35-6.33l14.35-4.43a5.07,5.07,0,0,1,6.33,3.34h0A5.08,5.08,0,0,1,213.61,284.78Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.28},children:r.jsx("path",{d:"M219.54,304l-87.55,27.05a5.08,5.08,0,0,1-6.34-3.35h0a5.07,5.07,0,0,1,3.35-6.33l87.55-27.05a5.1,5.1,0,0,1,6.34,3.35h0A5.08,5.08,0,0,1,219.54,304Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("path",{d:"M221.42,110.81l26.18,58.34a6.31,6.31,0,0,1-3.16,8.32L133.38,227.32a6.3,6.3,0,0,1-8.32-3.16L98.87,165.82a6.3,6.3,0,0,1,3.16-8.33l111.06-49.85a6.32,6.32,0,0,1,8.33,3.17Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.3}}),r.jsx("rect",{x:"200.4",y:"108.68",width:"3.89",height:"1",transform:"translate(-26.96 92.38) rotate(-24.16)",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("rect",{x:"184",y:"114.19",width:"12.13",height:"1",transform:"translate(-30.29 87.83) rotate(-24.16)",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("rect",{x:"99.33",y:"171.59",width:"1",height:"7.4",transform:"translate(-63.04 56.26) rotate(-24.18)",style:{fill:"var(--brand-primary, #407BFF)"}}),r.jsx("path",{d:"M217.7,107.43l-28.64,56.1a25.65,25.65,0,0,1-29.3,13.15L98.81,160.79a6.39,6.39,0,0,1,3.22-3.3l111.06-49.85A6.3,6.3,0,0,1,217.7,107.43Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.6}}),r.jsx("path",{d:"M257.07,179.23l-86.18,5.32A11.6,11.6,0,0,0,160,196.84l9.83,159.28A11.6,11.6,0,0,0,182.14,367l110.3-6.81a11.58,11.58,0,0,0,10.86-12.29L295,212.73Z",style:{fill:"#fff",opacity:.8}}),r.jsx("g",{style:{opacity:.22},children:r.jsx("path",{d:"M262.28,346l-71.71,4.43a5.08,5.08,0,0,1-5.36-4.75h0a5.09,5.09,0,0,1,4.74-5.37l71.71-4.42a5.08,5.08,0,0,1,5.37,4.74h0A5.08,5.08,0,0,1,262.28,346Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.22},children:r.jsx("path",{d:"M219.84,207.68l-37.93,2.34a5.09,5.09,0,0,1-5.37-4.74h0a5.09,5.09,0,0,1,4.75-5.37l37.93-2.34a5.07,5.07,0,0,1,5.36,4.74h0A5.08,5.08,0,0,1,219.84,207.68Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.22},children:r.jsx("path",{d:"M245.82,226.22l-62.67,3.86a5.07,5.07,0,0,1-5.37-4.74h0a5.08,5.08,0,0,1,4.75-5.37l62.66-3.86a5.07,5.07,0,0,1,5.37,4.74h0A5.08,5.08,0,0,1,245.82,226.22Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.22},children:r.jsx("path",{d:"M275.85,244.51l-91.46,5.64A5.09,5.09,0,0,1,179,245.4h0a5.07,5.07,0,0,1,4.74-5.36l91.47-5.65a5.08,5.08,0,0,1,5.36,4.75h0A5.08,5.08,0,0,1,275.85,244.51Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.22},children:r.jsx("path",{d:"M277.09,264.57l-53.17,3.28a5.08,5.08,0,0,1-5.37-4.74h0a5.07,5.07,0,0,1,4.74-5.37l53.17-3.28a5.07,5.07,0,0,1,5.37,4.74h0A5.08,5.08,0,0,1,277.09,264.57Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.22},children:r.jsx("path",{d:"M199.53,269.35l-13.91.86a5.07,5.07,0,0,1-5.36-4.74h0A5.08,5.08,0,0,1,185,260.1l13.91-.86a5.09,5.09,0,0,1,5.37,4.75h0A5.08,5.08,0,0,1,199.53,269.35Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.22},children:r.jsx("path",{d:"M278.33,284.63l-91.47,5.64a5.08,5.08,0,0,1-5.37-4.74h0a5.09,5.09,0,0,1,4.75-5.37l91.46-5.64a5.08,5.08,0,0,1,5.37,4.75h0A5.07,5.07,0,0,1,278.33,284.63Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.22},children:r.jsx("path",{d:"M244.27,306.87l-56.17,3.47a5.09,5.09,0,0,1-5.37-4.75h0a5.08,5.08,0,0,1,4.75-5.36l56.17-3.47a5.08,5.08,0,0,1,5.36,4.75h0A5.06,5.06,0,0,1,244.27,306.87Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.22},children:r.jsx("path",{d:"M279.56,304.7l-15,.92a5.07,5.07,0,0,1-5.36-4.74h0a5.07,5.07,0,0,1,4.74-5.37l15-.92a5.07,5.07,0,0,1,5.37,4.74h0A5.09,5.09,0,0,1,279.56,304.7Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("g",{style:{opacity:.22},children:r.jsx("path",{d:"M280.8,324.76l-91.46,5.64a5.08,5.08,0,0,1-5.37-4.74h0a5.08,5.08,0,0,1,4.74-5.37l91.47-5.64a5.07,5.07,0,0,1,5.36,4.74h0A5.07,5.07,0,0,1,280.8,324.76Z",style:{fill:"var(--brand-primary, #407BFF)"}})}),r.jsx("path",{d:"M257.07,179.23l1.49,24.12a11.6,11.6,0,0,0,12.29,10.87L295,212.73Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.22}}),r.jsx("path",{d:"M228.85,239.4h0a8.65,8.65,0,0,0-9-8.53H139.75c-6.07,0-12,4.93-13.14,11L95,403.82c-1.18,6.07,2.78,11,8.85,11h254c6.07,0,11.95-4.92,13.14-11l26.07-133.5c1.18-6.08-2.78-11-8.85-11H250C238,259.32,229.26,251.06,228.85,239.4Z",style:{fill:"var(--brand-primary, #407BFF)",opacity:.5}})]})]})}const Yf={pdf:"application/pdf",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",avif:"image/avif",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",csv:"text/csv",rar:"application/x-rar-compressed",zip:"application/zip","7z":"application/x-7z-compressed"},Jf={"image/jpeg":"JPG","image/png":"PNG","image/webp":"WEBP","image/gif":"GIF","image/avif":"AVIF","application/pdf":"PDF","application/vnd.ms-excel":"XLS","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX","text/csv":"CSV","application/zip":"ZIP","application/x-rar-compressed":"RAR","application/x-7z-compressed":"7Z"},Qf={JPG:"#10b981",PNG:"#6366f1",WEBP:"#06b6d4",GIF:"#ec4899",AVIF:"#8b5cf6",PDF:"#ef4444",XLS:"#22c55e",XLSX:"#16a34a",CSV:"#4ade80",ZIP:"#f59e0b",RAR:"#f97316","7Z":"#fb923c"};function Rf(e){if(!e.length)return;const n=new Set;return e.forEach(t=>{n.add(`.${t}`);const o=Yf[t];o&&n.add(o)}),[...n].join(",")}let e1=0;function Xo(){return`fs_${Date.now()}_${++e1}`}const t1=300;function n1({status:e}){return e==="saved"?r.jsx("span",{className:`${Q.estado} ${Q.estado_guardado}`,children:"Guardado"}):e==="pending"?r.jsx("span",{className:`${Q.estado} ${Q.estado_nuevo}`,children:"Nuevo"}):e==="uploading"?r.jsx("span",{className:`${Q.estado} ${Q.estado_subiendo}`,children:"Subiendo…"}):e==="deleted"?r.jsx("span",{className:`${Q.estado} ${Q.estado_eliminado}`,children:"Eliminado"}):null}const o1={network:"Error de red al subir","too-large":"Supera el límite de tamaño permitido","invalid-type":"Tipo de archivo no permitido",duplicate:"Ya existe un archivo con este nombre"};function r1({archivo:e,alEliminar:n,alRestaurar:t,alReintentar:o,subiendo:a,disableDeleteSaved:i}){const{id:s,name:l,status:c,error:u,entering:_,saliendo:g,restaurando:f}=e,d=c==="deleted",m=c==="uploading",p=c==="error",v=p&&u==="too-large",w=c==="saved"&&i,C=[Q.fila,_&&Q.fila_entrando,g&&Q.fila_saliendo,d&&Q.fila_eliminada,m&&Q.fila_subiendo,p&&Q.fila_error,v&&Q.fila_aviso,f&&Q.fila_restaurando].filter(Boolean).join(" ");return r.jsxs("li",{className:C,children:[r.jsx("span",{className:Q.fila_icono,children:m?r.jsx("span",{className:Q.spinner,"aria-hidden":"true"}):p?v?r.jsx(rl,{size:20}):r.jsx(Kf,{size:20}):r.jsx(Jn,{nombre:l,size:30})}),r.jsxs("div",{className:Q.fila_cuerpo,children:[r.jsx("span",{className:Q.fila_nombre,title:l,children:l}),p?r.jsxs("span",{className:Q.fila_error_texto,children:[o1[u],u==="network"&&r.jsx("button",{className:Q.btn_reintentar,onClick:()=>o(s),children:"Reintentar"})]}):r.jsx(n1,{status:c})]}),r.jsx("div",{className:Q.fila_acciones,children:d?r.jsxs("button",{className:Q.btn_restaurar,onClick:()=>t(s),disabled:a,"aria-label":`Restaurar ${l}`,children:[r.jsx(Zf,{size:14}),"Restaurar"]}):!g&&!w&&r.jsx("button",{className:Q.btn_eliminar,onClick:()=>n(s),disabled:m||a,"aria-label":`Eliminar ${l}`,title:"Eliminar",children:r.jsx(Gf,{size:18})})})]})}const a1=["pdf","jpg","jpeg","png"],i1=50;function s1({onClose:e,storagePath:n,onFilesChange:t,title:o="Importar archivos",subtitle:a,savedFiles:i=[],fileNameBuilder:s,maxFiles:l=1/0,allowedTypes:c=a1,maxSizeMB:u=i1,confirmation:_,firebaseStorage:g,onUploadError:f,onUploadComplete:d,disableDeleteSaved:m=!1}){const p=h.useRef(null),v=h.useRef(0),w=`${h.useId()}-titulo`,[C,k]=h.useState(!1),[z,A]=h.useState(!1),[N,P]=h.useState(()=>i.map(G=>({id:G.id,name:G.name,file:null,url:G.url,status:"saved"}))),[O,E]=h.useState(!1),[T,V]=h.useState([]),[S,b]=h.useState(!1),[x,F]=h.useState(!1);h.useEffect(()=>{const G=requestAnimationFrame(()=>k(!0));return()=>cancelAnimationFrame(G)},[]),h.useEffect(()=>{const G=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",G>0&&(document.body.style.paddingRight=`${G}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[]),h.useEffect(()=>{const G=Y=>{Y.key==="Escape"&&!z&&!S&&!x&&se()};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)});const $=N.filter(G=>G.status==="pending"||G.status==="saved"||G.status==="uploading").length,D=l!==1/0&&$>=l,B=S||D,X=N.some(G=>G.status==="pending")||N.some(G=>G.status==="deleted"&&G.url),U=Rf(c),L=h.useCallback(()=>{if(g&&typeof g=="object")return g;if(!wa.getApps().length)throw new Error("Firebase no está inicializado. Inicializa la app o pasa firebaseStorage como prop.");return yt.getStorage()},[g]),j=h.useCallback(G=>{if(B)return;const Y=[];let ce=l===1/0?1/0:l-$;const K=new Set(N.filter(H=>H.status==="pending"||H.status==="saved"||H.status==="uploading").map(H=>H.name.toLowerCase()));for(const H of G){const de=H.name.split(".").pop()?.toLowerCase()??"",te=H.size>u*1024*1024,pe=c.length>0&&!c.includes(de),Ye=K.has(H.name.toLowerCase());te?Y.push({id:Xo(),name:H.name,file:H,status:"error",error:"too-large",entering:!0}):pe?Y.push({id:Xo(),name:H.name,file:H,status:"error",error:"invalid-type",entering:!0}):Ye?Y.push({id:Xo(),name:H.name,file:H,status:"error",error:"duplicate",entering:!0}):ce>0&&(Y.push({id:Xo(),name:H.name,file:H,status:"pending",entering:!0}),ce!==1/0&&ce--)}if(!Y.length)return;const q=Y.map(H=>H.id);P(H=>[...H,...Y]),setTimeout(()=>{P(H=>H.map(de=>q.includes(de.id)?{...de,entering:!1}:de))},400)},[B,l,$,u,c,N]),W=G=>{if(G.preventDefault(),B)return;v.current++,E(!0);const Y=[];if(G.dataTransfer.items)for(let ce=0;ce<Math.min(G.dataTransfer.items.length,4);ce++){const K=G.dataTransfer.items[ce];if(K.kind==="file"){const q=Jf[K.type];q&&!Y.includes(q)&&Y.push(q)}}V(Y)},ie=G=>{G.preventDefault()},re=G=>{G.preventDefault(),v.current--,v.current<=0&&(v.current=0,E(!1),V([]))},ae=G=>{G.preventDefault(),v.current=0,E(!1),V([]),!B&&j(Array.from(G.dataTransfer.files))},me=G=>{j(Array.from(G.target.files??[])),G.target.value=""},ee=h.useCallback(G=>{P(Y=>{const ce=Y.find(K=>K.id===G);if(!ce)return Y;if(ce.status==="error"||ce.status==="pending"){const K=Y.map(q=>q.id===G?{...q,saliendo:!0}:q);return setTimeout(()=>P(q=>q.filter(H=>H.id!==G)),t1),K}return Y.map(K=>K.id===G?{...K,status:"deleted",prevStatus:K.status}:K)})},[]),fe=h.useCallback(G=>{P(Y=>Y.map(ce=>ce.id===G?{...ce,status:ce.prevStatus??"saved",restaurando:!0}:ce)),setTimeout(()=>{P(Y=>Y.map(ce=>ce.id===G?{...ce,restaurando:!1}:ce))},600)},[]),R=h.useCallback(G=>{P(Y=>Y.map(ce=>ce.id===G?{...ce,status:"pending",error:void 0}:ce))},[]),se=h.useCallback(()=>{z||S||(A(!0),k(!1),setTimeout(e,450))},[z,S,e]),_e=h.useCallback(async()=>{F(!1),b(!0);const G=N.filter(te=>te.status==="pending"&&te.file),Y=N.filter(te=>te.status==="deleted"&&te.url);P(te=>te.map(pe=>pe.status==="pending"?{...pe,status:"uploading"}:pe));const ce=L(),K=N.filter(te=>te.status==="saved").map(te=>({id:te.id,name:te.name,url:te.url})),q=[];for(const te of G){const pe=s?s(te.file):te.file.name,Ye=yt.ref(ce,`${n}/${pe}`);try{await yt.uploadBytes(Ye,te.file);const Oe=await yt.getDownloadURL(Ye);P(Ae=>Ae.map(Ne=>Ne.id===te.id?{...Ne,status:"saved",url:Oe}:Ne)),q.push({id:te.id,name:te.file.name,url:Oe})}catch(Oe){f?.(Oe instanceof Error?Oe:new Error(String(Oe))),P(Ae=>Ae.map(Ne=>Ne.id===te.id?{...Ne,status:"error",error:"network"}:Ne))}}const H=new Set(Y.map(te=>te.id));for(const te of Y)try{await yt.deleteObject(yt.ref(ce,te.url))}catch(pe){pe?.code!=="storage/object-not-found"&&f?.(pe instanceof Error?pe:new Error(String(pe)))}b(!1),P(te=>te.filter(pe=>pe.status!=="deleted"));const de=[...K.filter(te=>!H.has(te.id)),...q];t(de),d?.(de),se()},[N,n,s,L,f,t,d,se]),Se=()=>{!X||S||(_?F(!0):_e())},ge=G=>{G.target===G.currentTarget&&!S&&se()},le=[Q.zona_carga,O&&Q.zona_carga_activa,(S||D)&&Q.zona_carga_deshabilitada].filter(Boolean).join(" "),he=c.map(G=>G.toUpperCase());return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${Q.backdrop} ${C&&!z?Q.visible:""}`,onClick:ge,children:[r.jsxs("div",{className:`${Q.modal} ${C&&!z?Q.visible:""}`,role:"dialog","aria-modal":"true","aria-labelledby":w,children:[r.jsxs("header",{className:Q.encabezado,children:[r.jsxs("div",{className:Q.encabezado_textos,children:[r.jsx("h2",{id:w,className:Q.titulo,children:o}),a&&r.jsx("p",{className:Q.subtitulo,children:a})]}),r.jsxs("button",{className:Q.boton_cerrar,onClick:se,type:"button","aria-label":"Cerrar",disabled:S,children:[r.jsx("span",{className:Q.texto_esc,children:"ESC"}),r.jsx(ol,{size:16})]})]}),r.jsxs("div",{className:Q.cuerpo,children:[r.jsxs("div",{className:le,"aria-label":"Zona para arrastrar archivos",onDragEnter:W,onDragOver:ie,onDragLeave:re,onDrop:ae,children:[r.jsxs("div",{className:Q.zona_contenido,children:[r.jsx("div",{className:Q.zona_icono_flotante,"aria-hidden":"true",children:r.jsx(nl,{size:52})}),r.jsxs("div",{className:Q.zona_textos,children:[r.jsx("p",{className:Q.zona_titulo,children:"Arrastra archivos aquí"}),r.jsx("span",{className:Q.zona_separador,children:"o"}),r.jsxs("button",{className:Q.boton_elegir,type:"button",disabled:S,onClick:G=>{G.stopPropagation(),p.current?.click()},children:[r.jsx(Wf,{size:16}),"Elegir archivos"]})]}),r.jsxs("div",{className:Q.zona_meta,children:[r.jsxs("div",{className:Q.tipos_permitidos,children:[r.jsx("span",{className:Q.zona_meta_label,children:"Permitido:"}),he.map(G=>r.jsx("span",{className:Q.tipo_chip,children:G},G))]}),r.jsx("span",{className:Q.zona_meta_sep,children:"|"}),r.jsxs("span",{className:Q.zona_meta_tam,children:["Máx. ",u," MB"]}),l!==1/0&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:Q.zona_meta_sep,children:"|"}),r.jsxs("span",{className:Q.contador,children:[r.jsx("strong",{children:$}),"/",l]})]})]})]}),O&&r.jsxs("div",{className:Q.zona_arrastrando,children:[r.jsxs("div",{className:Q.drag_icon_wrap,"aria-hidden":"true",children:[r.jsx("span",{className:Q.drag_ring}),r.jsx("span",{className:`${Q.drag_ring} ${Q.drag_ring_2}`}),r.jsx("span",{className:`${Q.drag_ring} ${Q.drag_ring_3}`}),r.jsx("span",{className:Q.drag_icono,children:r.jsx(nl,{size:28})})]}),r.jsxs("div",{className:Q.drag_textos,children:[r.jsx("p",{className:Q.drag_titulo,children:"Suelta para agregar"}),r.jsx("p",{className:Q.drag_subtitulo,children:"Los archivos se agregarán a la lista"})]}),T.length>0&&r.jsx("div",{className:Q.drag_chips,children:T.map((G,Y)=>r.jsx("span",{className:Q.drag_chip,style:{"--chip-color":Qf[G]??"#94a3b8","--chip-delay":`${Y*60}ms`},children:G},G))})]})]}),D&&r.jsxs("div",{className:Q.banner_limite,role:"status",children:[r.jsx("span",{className:Q.banner_limite_icono,children:r.jsx(rl,{size:20})}),r.jsxs("div",{className:Q.banner_limite_cuerpo,children:[r.jsx("span",{className:Q.banner_limite_titulo,children:"Límite alcanzado"}),r.jsx("span",{className:Q.banner_limite_desc,children:"Elimina un archivo para poder agregar otro"})]}),r.jsxs("span",{className:Q.banner_limite_pill,children:[$,"/",l]})]}),r.jsxs("div",{className:Q.seccion_lista,children:[N.length>0&&r.jsx("div",{className:Q.cabecera_lista,children:r.jsx("span",{className:Q.cabecera_titulo,children:"Archivos"})}),N.length===0?r.jsxs("div",{className:Q.lista_vacia,children:[r.jsx(il,{className:Q.ilustracion_vacia}),r.jsx("span",{className:Q.lista_vacia_titulo,children:"Aún no hay archivos"}),r.jsx("span",{className:Q.lista_vacia_desc,children:"Arrastra o elige archivos para comenzar"})]}):r.jsx("ul",{className:Q.lista,children:N.map(G=>r.jsx(r1,{archivo:G,subiendo:S,alEliminar:ee,alRestaurar:fe,alReintentar:R,disableDeleteSaved:m},G.id))})]})]}),r.jsxs("footer",{className:Q.pie,children:[r.jsx("span",{className:Q.pie_info,children:l===1/0?`${$} archivo${$!==1?"s":""}`:`${$} de ${l} archivos`}),r.jsx(Ze,{variant:"light-active",color:"primary",size:"sm",radius:"lg",className:Q.btn_pie,onClick:Se,isDisabled:!X,isLoading:S,children:S?"Actualizando…":"Actualizar archivos"})]})]}),r.jsx("input",{ref:p,type:"file",multiple:!0,accept:U,className:Q.input_archivo,onChange:me,"aria-hidden":"true",tabIndex:-1})]}),_&&r.jsx(Xn,{isOpen:x,tipo:"advertencia",titulo:_.title,mensaje:_.message,textoConfirmar:_.confirmText??"Confirmar",loadingConfirmar:S,onConfirmar:_e,onCancelar:()=>F(!1)})]})}const $e={backdrop:"_backdrop_165ct_1",visible:"_visible_165ct_41",modal:"_modal_165ct_65",encabezado:"_encabezado_165ct_147",encabezado_textos:"_encabezado_textos_165ct_163",titulo:"_titulo_165ct_177",subtitulo:"_subtitulo_165ct_191",boton_cerrar:"_boton_cerrar_165ct_203",texto_esc:"_texto_esc_165ct_253",btn_volver:"_btn_volver_165ct_269",preview_nombre_header:"_preview_nombre_header_165ct_323",cuerpo_deslizante:"_cuerpo_deslizante_165ct_351",panel_lista:"_panel_lista_165ct_369",panel_oculto:"_panel_oculto_165ct_395",panel_preview:"_panel_preview_165ct_407",panel_visible:"_panel_visible_165ct_429",preview_contenido:"_preview_contenido_165ct_441",preview_imagen:"_preview_imagen_165ct_465",preview_imagen_cargando:"_preview_imagen_cargando_165ct_483",preview_loader:"_preview_loader_165ct_491",spinner_preview:"_spinner_preview_165ct_511",preview_iframe:"_preview_iframe_165ct_529",preview_placeholder:"_preview_placeholder_165ct_545",cabecera_lista:"_cabecera_lista_165ct_579",cabecera_titulo:"_cabecera_titulo_165ct_593",cabecera_etiqueta:"_cabecera_etiqueta_165ct_607",lista_vacia:"_lista_vacia_165ct_617",ilustracion_vacia:"_ilustracion_vacia_165ct_635",lista_vacia_titulo:"_lista_vacia_titulo_165ct_647",lista_vacia_desc:"_lista_vacia_desc_165ct_659",lista:"_lista_165ct_617",fila:"_fila_165ct_691",fila_icono:"_fila_icono_165ct_731",fila_cuerpo:"_fila_cuerpo_165ct_743",fila_nombre:"_fila_nombre_165ct_757",fila_acciones:"_fila_acciones_165ct_775",btn_accion:"_btn_accion_165ct_789",btn_descargado:"_btn_descargado_165ct_849",spinner:"_spinner_165ct_511",pie:"_pie_165ct_907",pie_info:"_pie_info_165ct_925"},l1={jpg:"image",jpeg:"image",png:"image",webp:"image",gif:"image",avif:"image",pdf:"pdf",xls:"excel",xlsx:"excel",csv:"excel",rar:"archive",zip:"archive","7z":"archive",tar:"archive"};function sl(e){const n=e.split(".").pop()?.toLowerCase()??"";return l1[n]??"generic"}const c1=["image","pdf"];async function ll(e,n){try{const t=await fetch(e,{mode:"cors"});if(!t.ok)throw new Error("fetch failed");const o=await t.blob(),a=URL.createObjectURL(o),i=document.createElement("a");i.href=a,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout(()=>URL.revokeObjectURL(a),100)}catch{window.open(e,"_blank","noopener,noreferrer")}}function d1({archivo:e,estadoDescarga:n,alDescargar:t,alPrevisualizar:o}){const a=sl(e.name),i=c1.includes(a),s=n==="done",l=n==="downloading";return r.jsxs("li",{className:$e.fila,children:[r.jsx("span",{className:$e.fila_icono,children:r.jsx(Jn,{nombre:e.name,size:30})}),r.jsx("div",{className:$e.fila_cuerpo,children:r.jsx("span",{className:$e.fila_nombre,title:e.name,children:e.name})}),r.jsxs("div",{className:$e.fila_acciones,children:[i&&r.jsx("button",{className:$e.btn_accion,"aria-label":`Ver ${e.name}`,title:"Vista previa",onClick:()=>o(e),children:r.jsx(Xf,{size:18})}),r.jsx("button",{className:`${$e.btn_accion} ${s?$e.btn_descargado:""}`,"aria-label":`Descargar ${e.name}`,title:s?"Descargado":"Descargar",disabled:l,onClick:()=>t(e),children:l?r.jsx("span",{className:$e.spinner,"aria-hidden":"true"}):s?r.jsx(Uf,{size:18}):r.jsx(al,{size:18})})]})]})}function u1({files:e,title:n="Archivos adjuntos",subtitle:t,onClose:o,className:a}){const s=`${h.useId()}-titulo`,[l,c]=h.useState(!1),[u,_]=h.useState(!1),[g,f]=h.useState({}),[d,m]=h.useState(!1),[p,v]=h.useState(null),[y,w]=h.useState(!1),[C,k]=h.useState(!1);h.useEffect(()=>{const x=requestAnimationFrame(()=>c(!0));return()=>cancelAnimationFrame(x)},[]),h.useEffect(()=>{if(!o)return;const x=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",x>0&&(document.body.style.paddingRight=`${x}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[o]);const z=h.useCallback(()=>{u||(_(!0),c(!1),setTimeout(()=>o?.(),450))},[u,o]);h.useEffect(()=>{if(!o)return;const x=F=>{F.key==="Escape"&&(p?(v(null),w(!1)):z())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[o,p,z]);const A=h.useCallback(async x=>{f(F=>({...F,[x.id]:"downloading"})),await ll(x.url,x.name),f(F=>({...F,[x.id]:"done"})),setTimeout(()=>{f(F=>{const I={...F};return delete I[x.id],I})},2e3)},[]),N=async()=>{if(!(d||!e.length)){m(!0);for(const x of e)await ll(x.url,x.name);m(!1)}},P=x=>{w(!1),k(!0),v(x)},O=()=>{v(null),w(!1),k(!1)},E=t??`${e.length} archivo${e.length!==1?"s":""}`,T=p?sl(p.name):null,V=T==="image",S=T==="pdf",b=r.jsxs("div",{className:`${$e.modal} ${l&&!u?$e.visible:""}`,role:"dialog","aria-modal":"true","aria-labelledby":s,children:[r.jsx("header",{className:$e.encabezado,children:p?r.jsxs(r.Fragment,{children:[r.jsxs("button",{className:$e.btn_volver,onClick:O,type:"button","aria-label":"Volver a la lista",children:[r.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:r.jsx("path",{d:"M19 12H5M12 5l-7 7 7 7"})}),"Volver"]}),r.jsx("span",{className:$e.preview_nombre_header,title:p.name,children:p.name})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:$e.encabezado_textos,children:[r.jsx("h2",{id:s,className:$e.titulo,children:n}),r.jsx("p",{className:$e.subtitulo,children:E})]}),o&&r.jsxs("button",{className:$e.boton_cerrar,onClick:z,type:"button","aria-label":"Cerrar",children:[r.jsx("span",{className:$e.texto_esc,children:"ESC"}),r.jsx(ol,{size:16})]})]})}),r.jsxs("div",{className:$e.cuerpo_deslizante,children:[r.jsxs("div",{className:`${$e.panel_lista} ${p?$e.panel_oculto:""}`,inert:p?"":void 0,children:[r.jsxs("div",{className:$e.cabecera_lista,children:[r.jsx("span",{className:$e.cabecera_titulo,children:"Documentos"}),r.jsx("span",{className:$e.cabecera_etiqueta,children:"Solo lectura"})]}),e.length===0?r.jsxs("div",{className:$e.lista_vacia,children:[r.jsx(il,{className:$e.ilustracion_vacia}),r.jsx("span",{className:$e.lista_vacia_titulo,children:"Sin archivos adjuntos"}),r.jsx("span",{className:$e.lista_vacia_desc,children:"Este registro no tiene documentos por el momento"})]}):r.jsx("ul",{className:$e.lista,children:e.map(x=>r.jsx(d1,{archivo:x,estadoDescarga:g[x.id]??"idle",alDescargar:A,alPrevisualizar:P},x.id))})]}),r.jsx("div",{className:`${$e.panel_preview} ${p?$e.panel_visible:""}`,inert:p?void 0:"",children:p&&r.jsx("div",{className:$e.preview_contenido,children:V&&!y?r.jsxs(r.Fragment,{children:[C&&r.jsx("div",{className:$e.preview_loader,"aria-hidden":"true",children:r.jsxs("svg",{className:$e.spinner_preview,viewBox:"0 0 44 44",fill:"none",role:"presentation",children:[r.jsx("circle",{cx:"22",cy:"22",r:"17",stroke:"currentColor",strokeWidth:"2.5",opacity:"0.1"}),r.jsx("circle",{cx:"22",cy:"22",r:"17",stroke:"var(--brand-primary, #407bff)",strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:"32 75",strokeDashoffset:"0"})]})}),r.jsx("img",{src:p.url,alt:p.name,className:`${$e.preview_imagen} ${C?$e.preview_imagen_cargando:""}`,onLoad:()=>k(!1),onError:()=>{k(!1),w(!0)}})]}):y?r.jsxs("div",{className:$e.preview_placeholder,children:[r.jsx(Jn,{nombre:p.name,size:64}),r.jsx("p",{children:"No se pudo cargar la imagen"}),r.jsx("code",{children:p.name})]}):S?r.jsx("object",{data:p.url,type:"application/pdf",className:$e.preview_iframe,"aria-label":p.name,children:r.jsxs("div",{className:$e.preview_placeholder,children:[r.jsx(Jn,{nombre:p.name,size:64}),r.jsx("p",{children:"No se puede mostrar el PDF en este navegador"}),r.jsx("code",{children:p.name})]})}):r.jsxs("div",{className:$e.preview_placeholder,children:[r.jsx(Jn,{nombre:p.name,size:64}),r.jsx("p",{children:"Vista previa no disponible"}),r.jsx("code",{children:p.name})]})})})]}),r.jsxs("footer",{className:$e.pie,children:[p?r.jsx("span",{className:$e.pie_info,children:"Vista previa"}):r.jsxs("span",{className:$e.pie_info,children:[e.length," archivo",e.length!==1?"s":""," disponible",e.length!==1?"s":""]}),r.jsx(Ze,{variant:"light-active",color:"primary",size:"sm",radius:"lg",startContent:r.jsx(al,{size:14}),onClick:p?()=>A(p):N,isDisabled:!p&&!e.length,isLoading:!p&&d,type:"button",children:p?"Descargar":d?"Descargando…":"Descargar todo"})]})]});return o?r.jsx("div",{className:`${$e.backdrop} ${l&&!u?$e.visible:""} ${a??""}`,onClick:x=>{x.target===x.currentTarget&&!p&&z()},children:b}):r.jsx("div",{className:a,children:b})}const Z={backdrop:"_backdrop_1i685_1",visible:"_visible_1i685_37",modal:"_modal_1i685_61",encabezado:"_encabezado_1i685_145",encabezado_textos:"_encabezado_textos_1i685_161",titulo:"_titulo_1i685_177",subtitulo:"_subtitulo_1i685_193",boton_cerrar:"_boton_cerrar_1i685_205",pasos:"_pasos_1i685_253",paso:"_paso_1i685_253",completado:"_completado_1i685_305",paso_circulo:"_paso_circulo_1i685_313",activo:"_activo_1i685_355",paso_etiqueta_grupo:"_paso_etiqueta_grupo_1i685_417",paso_etiqueta:"_paso_etiqueta_1i685_417",divisor:"_divisor_1i685_473",cuerpo:"_cuerpo_1i685_485",zona_idle:"_zona_idle_1i685_505",plantilla_card:"_plantilla_card_1i685_521",plantilla_icono_wrap:"_plantilla_icono_wrap_1i685_583",plantilla_card_texto:"_plantilla_card_texto_1i685_625",plantilla_titulo:"_plantilla_titulo_1i685_641",plantilla_sub:"_plantilla_sub_1i685_655",zona_drop:"_zona_drop_1i685_665",sobre:"_sobre_1i685_731",con_archivo:"_con_archivo_1i685_739",zona_drop_icono_wrap:"_zona_drop_icono_wrap_1i685_787",zona_drop_icono_ok:"_zona_drop_icono_ok_1i685_823",zona_drop_titulo:"_zona_drop_titulo_1i685_861",zona_drop_sub:"_zona_drop_sub_1i685_879",zona_drop_texto:"_zona_drop_texto_1i685_893",zona_drop_pie:"_zona_drop_pie_1i685_907",tipo_chip:"_tipo_chip_1i685_923",filtro_nombre_hint:"_filtro_nombre_hint_1i685_955",archivo_info:"_archivo_info_1i685_967",archivo_nombre:"_archivo_nombre_1i685_983",archivo_tamano:"_archivo_tamano_1i685_1003",zona_procesando:"_zona_procesando_1i685_1013",spinner_wrap:"_spinner_wrap_1i685_1033",spinner_ring:"_spinner_ring_1i685_1041",spinner_icono:"_spinner_icono_1i685_1059",procesando_texto:"_procesando_texto_1i685_1089",procesando_titulo:"_procesando_titulo_1i685_1105",procesando_sub:"_procesando_sub_1i685_1121",barra_progreso_contenedor:"_barra_progreso_contenedor_1i685_1141",barra_progreso:"_barra_progreso_1i685_1141",zona_resultado:"_zona_resultado_1i685_1199",banner:"_banner_1i685_1217",exito:"_exito_1i685_1235",error:"_error_1i685_1247",banner_icono:"_banner_icono_1i685_1259",banner_texto:"_banner_texto_1i685_1267",banner_titulo:"_banner_titulo_1i685_1281",banner_sub:"_banner_sub_1i685_1293",tabs:"_tabs_1i685_1303",tab:"_tab_1i685_1303",tab_badge:"_tab_badge_1i685_1371",tab_badge_ok:"_tab_badge_ok_1i685_1399",tab_panel:"_tab_panel_1i685_1409",preview_panel_wrap:"_preview_panel_wrap_1i685_1425",info_preview:"_info_preview_1i685_1441",tabla_contenedor:"_tabla_contenedor_1i685_1469",tabla:"_tabla_1i685_1469",fila_error:"_fila_error_1i685_1541",celda_fila:"_celda_fila_1i685_1573",celda_estado:"_celda_estado_1i685_1587",chip_valida:"_chip_valida_1i685_1605",chip_error_count:"_chip_error_count_1i685_1625",preview_truncada:"_preview_truncada_1i685_1645",errores_lista:"_errores_lista_1i685_1659",error_item:"_error_item_1i685_1679",error_cabecera:"_error_cabecera_1i685_1711",error_ids:"_error_ids_1i685_1727",error_ids_label:"_error_ids_label_1i685_1745",error_id_chip:"_error_id_chip_1i685_1759",error_sin_id:"_error_sin_id_1i685_1787",error_fila_tag:"_error_fila_tag_1i685_1799",error_detalle:"_error_detalle_1i685_1821",error_linea:"_error_linea_1i685_1835",error_campo_nombre:"_error_campo_nombre_1i685_1859",error_campo_msg:"_error_campo_msg_1i685_1873",error_mensajes_lista:"_error_mensajes_lista_1i685_1885",error_mensaje_item:"_error_mensaje_item_1i685_1897",opciones_prefijo:"_opciones_prefijo_1i685_1907",opciones_bloque:"_opciones_bloque_1i685_1915",error_expandir_btn:"_error_expandir_btn_1i685_1937",pie:"_pie_1i685_1971",alerta_inline:"_alerta_inline_1i685_1989",paso_contenido:"_paso_contenido_1i685_2027"};function _1({size:e=48}){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",children:[r.jsx("path",{fill:"currentColor",d:"M6.5 18v-.09c0-.865 0-1.659.087-2.304c.095-.711.32-1.463.938-2.08c.618-.619 1.37-.844 2.08-.94c.646-.086 1.44-.086 2.306-.086h.178c.866 0 1.66 0 2.305.087c.711.095 1.463.32 2.08.938c.619.618.844 1.37.94 2.08c.085.637.086 1.416.086 2.267c2.573-.55 4.5-2.812 4.5-5.52c0-2.47-1.607-4.572-3.845-5.337C17.837 4.194 15.415 2 12.476 2C9.32 2 6.762 4.528 6.762 7.647c0 .69.125 1.35.354 1.962a4.4 4.4 0 0 0-.83-.08C3.919 9.53 2 11.426 2 13.765S3.919 18 6.286 18z",opacity:".5"}),r.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 14c-1.886 0-2.828 0-3.414.586S8 16.114 8 18s0 2.828.586 3.414S10.114 22 12 22s2.828 0 3.414-.586S16 19.886 16 18s0-2.828-.586-3.414S13.886 14 12 14m1.805 3.084l-1.334-1.333a.667.667 0 0 0-.942 0l-1.334 1.333a.667.667 0 1 0 .943.943l.195-.195v1.946a.667.667 0 0 0 1.334 0v-1.946l.195.195a.667.667 0 0 0 .943-.943",clipRule:"evenodd"})]})}function f1({size:e=52}){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:r.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-.99M4 4.735v14.53l10 1.429V3.306zM17 19h3V5h-3V3h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-4zm-6.8-7l2.8 4h-2.4L9 13.714L7.4 16H5l2.8-4L5 8h2.4L9 10.286L10.6 8H13z"})})}function p1({size:e=20}){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 23 23",fill:"none","aria-hidden":!0,children:r.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[r.jsx("path",{d:"M17 9.002c2.175.012 3.353.109 4.121.877C22 10.758 22 12.172 22 15v1c0 2.829 0 4.243-.879 5.122C20.243 22 18.828 22 16 22H8c-2.828 0-4.243 0-5.121-.878C2 20.242 2 18.829 2 16v-1c0-2.828 0-4.242.879-5.121c.768-.768 1.946-.865 4.121-.877"}),r.jsx("path",{strokeLinejoin:"round",d:"M12 2v13m0 0l-3-3.5m3 3.5l3-3.5"})]})})}function g1({size:e=16}){return r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:r.jsx("path",{d:"M12 4 4 12M4 4l8 8",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})}function cl({size:e=16}){return r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:r.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function dl({size:e=22}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none","aria-hidden":!0,children:[r.jsx("circle",{cx:"11",cy:"11",r:"10",fill:"currentColor",opacity:".15"}),r.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"currentColor",strokeWidth:"1.5"}),r.jsx("path",{d:"M11 7v4.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),r.jsx("circle",{cx:"11",cy:"15",r:"1",fill:"currentColor"})]})}function ul({size:e=14}){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",children:r.jsx("path",{fill:"currentColor",d:"M12 4a8 8 0 1 0 0 16a8 8 0 0 0 0-16M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12m5.793-4.207a1 1 0 0 1 1.414 0L12 10.586l2.793-2.793a1 1 0 1 1 1.414 1.414L13.414 12l2.793 2.793a1 1 0 0 1-1.414 1.414L12 13.414l-2.793 2.793a1 1 0 0 1-1.414-1.414L10.586 12L7.793 9.207a1 1 0 0 1 0-1.414Z"})})}function h1({size:e=14}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,children:[r.jsx("rect",{x:"1",y:"1",width:"12",height:"12",rx:"2",fill:"currentColor",opacity:".1"}),r.jsx("rect",{x:"1",y:"1",width:"12",height:"12",rx:"2",stroke:"currentColor",strokeWidth:"1.2"}),r.jsx("path",{d:"M1 5h12M5 5v8",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function m1({size:e=14}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,children:[r.jsx("path",{d:"M2 7A5 5 0 1 1 7 12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),r.jsx("path",{d:"M2 4v3h3",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})}function v1({size:e=22}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none","aria-hidden":!0,children:[r.jsx("circle",{cx:"11",cy:"11",r:"10",fill:"currentColor",opacity:".15"}),r.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"currentColor",strokeWidth:"1.5"}),r.jsx("path",{d:"M7 11l2.5 2.5L15 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function b1({size:e=24}){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",children:r.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[r.jsx("path",{strokeDasharray:"2 4",strokeDashoffset:"6",d:"M12 21c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9",children:r.jsx("animate",{attributeName:"stroke-dashoffset",dur:"0.6s",repeatCount:"indefinite",values:"6;0"})}),r.jsx("path",{strokeDasharray:"32",strokeDashoffset:"32",d:"M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9",children:r.jsx("animate",{fill:"freeze",attributeName:"stroke-dashoffset",begin:"0.1s",dur:"0.4s",values:"32;0"})}),r.jsx("path",{strokeDasharray:"10",strokeDashoffset:"10",d:"M12 16v-7.5",children:r.jsx("animate",{fill:"freeze",attributeName:"stroke-dashoffset",begin:"0.5s",dur:"0.2s",values:"10;0"})}),r.jsx("path",{strokeDasharray:"6",strokeDashoffset:"6",d:"M12 8.5l3.5 3.5M12 8.5l-3.5 3.5",children:r.jsx("animate",{fill:"freeze",attributeName:"stroke-dashoffset",begin:"0.7s",dur:"0.2s",values:"6;0"})})]})})}function _l({size:e=22}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none","aria-hidden":!0,children:[r.jsx("path",{d:"M11 3L4 6v5c0 4.418 3.134 8.55 7 9.5 3.866-.95 7-5.082 7-9.5V6l-7-3z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),r.jsx("path",{d:"M8 11l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function w1({size:e=22}){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 32 32",children:[r.jsx("circle",{cx:"26",cy:"26",r:"4",fill:"currentColor"}),r.jsx("path",{fill:"currentColor",d:"M10 13h2v2h-2zm0 5h2v2h-2zm0 5h2v2h-2zm4-10h8v2h-8zm0 5h8v2h-8zm0 5h4v2h-4z"}),r.jsx("path",{fill:"currentColor",d:"M7 28V7h3v3h12V7h3v11h2V7a2 2 0 0 0-2-2h-3V4a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2v1H7a2 2 0 0 0-2 2v21a2 2 0 0 0 2 2h11v-2Zm5-24h8v4h-8Z"})]})}let gn=null,Qn=!1;const y1=()=>{if(typeof window>"u"||Qn)return null;if(!gn)try{gn=new Worker(new URL("/assets/excel.worker-CFqewIyg.js",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:or&&or.tagName.toUpperCase()==="SCRIPT"&&or.src||new URL("index.umd.cjs",document.baseURI).href),{type:"module"}),gn.onerror=()=>{gn=null,Qn=!0}}catch{return Qn=!0,null}return gn},C1=e=>{if(e==null)return"";if(typeof e=="string")return e.trim();if(e instanceof Date){const n=String(e.getDate()).padStart(2,"0"),t=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getFullYear());return`${n}/${t}/${o}`}return typeof e=="number"||typeof e=="boolean"?String(e):""},x1=(e,n)=>{const t=mn.read(e,{type:"array",cellDates:!0,dateNF:"dd/mm/yyyy"}),o=t.Sheets[t.SheetNames[0]];return mn.utils.sheet_to_json(o,{defval:"",raw:!1,dateNF:"dd/mm/yyyy",range:n}).filter(i=>Object.values(i).some(s=>s!=="")).map(i=>{const s={};for(const l of Object.keys(i))s[l]=C1(i[l]);return s})},$1=(e,n,t)=>new Promise((o,a)=>{const i=setTimeout(()=>{s(),gn=null,Qn=!0,a(new Error("timeout"))},1e4),s=()=>{clearTimeout(i),e.removeEventListener("message",l),e.removeEventListener("error",c)},l=u=>{s(),u.data.exito?o(u.data.filas):a(new Error(u.data.error))},c=()=>{s(),gn=null,Qn=!0,a(new Error("worker-error"))};e.addEventListener("message",l),e.addEventListener("error",c),e.postMessage({buffer:n,filasOmitir:t},[n])}),fl=(e,n=0)=>new Promise((t,o)=>{const a=new FileReader;a.onerror=()=>o(new Error("No se pudo leer el archivo")),a.onload=async i=>{const s=i.target.result,l=y1();if(l)try{const c=await $1(l,s.slice(0),n);t(c);return}catch{}try{t(x1(s,n))}catch(c){o(c instanceof Error?c:new Error("Error al procesar el archivo"))}},a.readAsArrayBuffer(e)}),pl=[".xlsx",".xls",".csv"];function gl(e){const n=e.name.toLowerCase();return pl.some(t=>n.endsWith(t))?null:`Formato no soportado. Usa: ${pl.join(", ")}`}function hl(e,n){return typeof n=="string"?e.name.toLowerCase().includes(n.toLowerCase())?null:`El archivo debe contener "${n}" en su nombre`:n.test(e.name)?null:"El nombre del archivo no es el esperado"}function S1(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}const Rn=e=>e.trim().toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"");function k1(e){const n={};for(const[t,o]of Object.entries(e))n[Rn(t)]=o;return n}function N1(e,n){const t=e.map((o,a)=>{const i=k1(o),s=[],l={};for(const c of n){const u=Rn(c.columna??c.etiqueta),_=i[u]??"",g=(c.validadores??[]).map(f=>f(_,i)).filter(f=>f!==null);g.length>0&&s.push({fila:a+1,campo:String(c.campo),etiqueta:c.etiqueta,valor:_,mensajes:g});try{l[String(c.campo)]=c.transformar?c.transformar(_):_}catch{l[String(c.campo)]=_}}return{indice:a+1,datos:l,errores:s,valida:s.length===0}});return{filasValidas:t.filter(o=>o.valida).map(o=>o.datos),filasProcesadas:t,totalFilas:t.length,totalErrores:t.reduce((o,a)=>o+a.errores.length,0)}}function E1(e,n="plantilla.xlsx"){const t=mn.utils.aoa_to_sheet([e.map(a=>a.columna??a.etiqueta)]),o=mn.utils.book_new();mn.utils.book_append_sheet(o,t,"Plantilla"),mn.writeFile(o,n)}async function M1(e,n){try{const o=await(await fetch(e)).blob(),a=document.createElement("a");a.href=URL.createObjectURL(o),a.download=n,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(a.href)}catch{window.open(e,"_blank")}}function I1(e,n,t){const o=Object.fromEntries(t.map(a=>[Rn(a.etiqueta),String(a.campo)]));return n.map(a=>{const i=o[Rn(a)]??Rn(a);return String(e[i]??"").trim()}).filter(Boolean)}const F1=[{label:"Subir",Icono:b1},{label:"Validar",Icono:_l},{label:"Resultados",Icono:w1}],z1={idle:0,procesando:1,resultado:2};function L1({campos:e,plantillaUrl:n,plantillaFilename:t,generarPlantilla:o,onGenerarPlantilla:a,archivo:i,arrastrandoSobre:s,inputId:l,filtroNombre:c,onDragOver:u,onDragLeave:_,onDrop:g,onClickZona:f}){const d=n||o||a,m=()=>{a?a():n?M1(n,t):o&&E1(e,t)};return r.jsxs("div",{className:Z.zona_idle,children:[d&&r.jsxs("button",{className:Z.plantilla_card,type:"button",onClick:m,children:[r.jsx("div",{className:Z.plantilla_icono_wrap,children:r.jsx(p1,{size:20})}),r.jsxs("div",{className:Z.plantilla_card_texto,children:[r.jsx("span",{className:Z.plantilla_titulo,children:"Descargar plantilla"}),r.jsx("span",{className:Z.plantilla_sub,children:n?"Descarga la plantilla oficial para llenar":"Genera la plantilla con las columnas esperadas"})]})]}),r.jsxs("div",{className:`${Z.zona_drop} ${s?Z.sobre:""} ${i?Z.con_archivo:""}`,role:"button",tabIndex:0,"aria-label":"Zona para arrastrar o seleccionar archivo Excel",onDragOver:u,onDragLeave:_,onDrop:g,onClick:f,onKeyDown:p=>(p.key==="Enter"||p.key===" ")&&f(),children:[i?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`${Z.zona_drop_icono_wrap} ${Z.zona_drop_icono_ok}`,children:r.jsx(f1,{size:38})}),r.jsxs("div",{className:Z.archivo_info,children:[r.jsx("span",{className:Z.archivo_nombre,children:i.name}),r.jsx("span",{className:Z.archivo_tamano,children:S1(i.size)})]}),r.jsx("p",{className:Z.zona_drop_sub,children:"Haz clic para cambiar el archivo"})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Z.zona_drop_icono_wrap,children:r.jsx(_1,{size:48})}),r.jsxs("div",{className:Z.zona_drop_texto,children:[r.jsx("p",{className:Z.zona_drop_titulo,children:"Arrastra tu archivo aquí"}),r.jsx("p",{className:Z.zona_drop_sub,children:"o haz clic para seleccionar desde tu equipo"})]}),r.jsxs("div",{className:Z.zona_drop_pie,children:[["XLSX","XLS","CSV"].map(p=>r.jsx("span",{className:Z.tipo_chip,children:p},p)),typeof c=="string"&&r.jsxs("span",{className:Z.filtro_nombre_hint,children:["Nombre: ",r.jsx("strong",{children:c})]})]})]}),r.jsx("input",{id:l,type:"file",accept:".xlsx,.xls,.csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/csv",tabIndex:-1})]})]})}function A1({nombre:e}){return r.jsxs("div",{className:Z.zona_procesando,children:[r.jsxs("div",{className:Z.spinner_wrap,children:[r.jsx("div",{className:Z.spinner_ring,"aria-hidden":!0}),r.jsx("div",{className:Z.spinner_icono,children:r.jsx(_l,{size:18})})]}),r.jsxs("div",{className:Z.procesando_texto,children:[r.jsx("p",{className:Z.procesando_titulo,children:"Validando datos…"}),r.jsx("p",{className:Z.procesando_sub,children:e})]}),r.jsx("div",{className:Z.barra_progreso_contenedor,role:"progressbar","aria-label":"Procesando",children:r.jsx("div",{className:Z.barra_progreso})})]})}function D1({resultado:e,campos:n,identificadores:t}){const[o,a]=h.useState(e.totalErrores>0?"errores":"preview"),i=e.totalErrores>0,s=e.filasProcesadas.filter(l=>!l.valida);return r.jsxs("div",{className:Z.zona_resultado,children:[r.jsxs("div",{className:`${Z.banner} ${i?Z.error:Z.exito}`,children:[r.jsx("div",{className:Z.banner_icono,children:i?r.jsx(dl,{size:22}):r.jsx(v1,{size:22})}),r.jsxs("div",{className:Z.banner_texto,children:[r.jsx("span",{className:Z.banner_titulo,children:i?`${s.length} fila${s.length!==1?"s":""} con errores`:`${e.totalFilas} registro${e.totalFilas!==1?"s":""} ${e.totalFilas!==1?"listos":"listo"} para importar`}),r.jsx("span",{className:Z.banner_sub,children:i?"Corrige los errores en el archivo y vuelve a intentarlo":"Todos los datos pasaron la validación correctamente"})]})]}),r.jsxs("div",{className:Z.tabs,role:"tablist",children:[i&&r.jsxs("button",{role:"tab","aria-selected":o==="errores",className:`${Z.tab} ${o==="errores"?Z.activo:""}`,onClick:()=>a("errores"),children:[r.jsx(ul,{size:15}),"Errores",r.jsx("span",{className:Z.tab_badge,children:s.length})]}),r.jsxs("button",{role:"tab","aria-selected":o==="preview",className:`${Z.tab} ${o==="preview"?Z.activo:""}`,onClick:()=>a("preview"),children:[r.jsx(h1,{size:13}),"Vista previa",r.jsx("span",{className:`${Z.tab_badge} ${Z.tab_badge_ok}`,children:e.filasProcesadas.length})]})]}),o==="errores"?r.jsx("div",{className:`${Z.errores_lista} ${Z.tab_panel}`,role:"tabpanel",children:s.map(l=>r.jsx(T1,{fila:l,campos:n,identificadores:t},l.indice))},"errores"):r.jsxs("div",{className:`${Z.preview_panel_wrap} ${Z.tab_panel}`,role:"tabpanel",children:[r.jsxs("div",{className:Z.info_preview,children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:r.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),"Vista previa — se muestran hasta 200 filas."]}),r.jsx("div",{className:Z.tabla_contenedor,children:r.jsx(O1,{filas:e.filasProcesadas,campos:n})})]},"preview")]})}const ml=100,vl=" — opciones válidas: ",bl=6;function wl({texto:e}){const[n,t]=h.useState(!1),o=e.indexOf(vl);if(o>=0){const a=e.slice(0,o),s=e.slice(o+vl.length).split(", ").map(u=>u.trim()).filter(Boolean),l=n?s:s.slice(0,bl),c=s.length-bl;return r.jsxs("span",{children:[r.jsxs("span",{className:Z.opciones_prefijo,children:[a," — opciones válidas:"]})," ",r.jsxs("span",{className:Z.opciones_bloque,children:[l.join(", "),!n&&c>0&&"…"]}),!n&&c>0&&r.jsxs("button",{className:Z.error_expandir_btn,type:"button",onClick:u=>{u.stopPropagation(),t(!0)},children:["▾ +",c]}),n&&c>0&&r.jsx("button",{className:Z.error_expandir_btn,type:"button",onClick:u=>{u.stopPropagation(),t(!1)},children:"▴ menos"})]})}return e.length<=ml?r.jsx("span",{children:e}):r.jsxs("span",{children:[n?e:`${e.slice(0,ml)}…`,r.jsx("button",{className:Z.error_expandir_btn,type:"button",onClick:a=>{a.stopPropagation(),t(i=>!i)},children:n?" ▴ ver menos":" ▾ ver más"})]})}function P1({err:e}){return r.jsxs("div",{className:Z.error_linea,children:[r.jsx("span",{className:Z.error_campo_nombre,children:e.etiqueta}),r.jsx("span",{className:Z.error_campo_msg,children:e.mensajes.length===1?r.jsx(wl,{texto:e.mensajes[0]}):r.jsx("span",{className:Z.error_mensajes_lista,children:e.mensajes.map((n,t)=>r.jsx("span",{className:Z.error_mensaje_item,children:r.jsx(wl,{texto:n})},t))})})]})}function T1({fila:e,campos:n,identificadores:t}){const o=t.length?I1(e.datos,t,n):[];return r.jsxs("div",{className:Z.error_item,children:[r.jsxs("div",{className:Z.error_cabecera,children:[o.length>0?r.jsxs("div",{className:Z.error_ids,children:[r.jsx("span",{className:Z.error_ids_label,children:"Identificador:"}),o.map((a,i)=>r.jsx("span",{className:Z.error_id_chip,children:a},i))]}):r.jsx("span",{className:Z.error_sin_id,children:"Sin identificador"}),r.jsxs("span",{className:Z.error_fila_tag,children:["Fila ",e.indice]})]}),r.jsx("div",{className:Z.error_detalle,children:e.errores.map((a,i)=>r.jsx(P1,{err:a},i))})]})}const va=200;function O1({filas:e,campos:n}){const t=e.slice(0,va),o=e.length>va;return r.jsxs("table",{className:Z.tabla,children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{className:Z.celda_fila,children:"#"}),n.map(a=>r.jsx("th",{children:a.etiqueta},String(a.campo))),r.jsx("th",{className:Z.celda_estado,children:"Estado"})]})}),r.jsxs("tbody",{children:[t.map(a=>r.jsxs("tr",{className:a.valida?"":Z.fila_error,children:[r.jsx("td",{className:Z.celda_fila,children:a.indice}),n.map(i=>r.jsx("td",{children:String(a.datos[String(i.campo)]??"")},String(i.campo))),r.jsx("td",{className:Z.celda_estado,children:a.valida?r.jsx("span",{className:Z.chip_valida,children:"✓ Válida"}):r.jsxs("span",{className:Z.chip_error_count,children:[a.errores.length," error",a.errores.length!==1?"es":""]})})]},a.indice)),o&&r.jsx("tr",{children:r.jsxs("td",{colSpan:n.length+2,className:Z.preview_truncada,children:["Se muestran ",va," de ",e.length," filas totales"]})})]})]})}function V1({campos:e,onImportar:n,onClose:t,title:o="Importar archivo Excel",subtitle:a,plantillaUrl:i,plantillaFilename:s="plantilla.xlsx",generarPlantilla:l,onGenerarPlantilla:c,rutaStorage:u,filasOmitir:_=0,identificadores:g=[],maxFilas:f,filtroNombre:d,confirmacion:m}){const[p,v]=h.useState(!1),[y,w]=h.useState("idle"),[C,k]=h.useState(null),[z,A]=h.useState(!1),[N,P]=h.useState(null),[O,E]=h.useState(null),[T,V]=h.useState(!1),[S,b]=h.useState(!1),[x,F]=h.useState(null),I=h.useRef(null),$=h.useRef(0),D=h.useId();h.useEffect(()=>{const ee=requestAnimationFrame(()=>v(!0));return()=>cancelAnimationFrame(ee)},[]),h.useEffect(()=>{const ee=fe=>{fe.key==="Escape"&&B()};return document.addEventListener("keydown",ee),()=>document.removeEventListener("keydown",ee)},[]),h.useEffect(()=>{const ee=document.getElementById(D);ee&&(I.current=ee,ee.onchange=fe=>{const R=fe.target.files?.[0];if(!R)return;const se=gl(R)??(d?hl(R,d):null);if(se){E(se),ee.value="";return}E(null),k(R),ee.value=""})},[D,d]);const B=h.useCallback(()=>{v(!1),setTimeout(t,380)},[t]),X=h.useCallback(async ee=>{k(ee),w("procesando"),E(null);try{const fe=await fl(ee,_),R=f?fe.slice(0,f):fe,se=N1(R,e);if(se.totalFilas===0){E("El archivo no contiene datos. Verifica que tenga filas con información debajo del encabezado."),k(null),w("idle");return}P(se),w("resultado")}catch(fe){E(fe instanceof Error?fe.message:"Error al procesar el archivo"),w("idle")}},[e,_,f]),U=h.useCallback(ee=>{ee.preventDefault(),$.current+=1,A(!0)},[]),L=h.useCallback(ee=>{ee.preventDefault(),$.current-=1,$.current<=0&&($.current=0,A(!1))},[]),j=h.useCallback(ee=>{ee.preventDefault(),$.current=0,A(!1);const fe=ee.dataTransfer.files[0];if(!fe)return;const R=gl(fe)??(d?hl(fe,d):null);if(R){E(R);return}E(null),k(fe)},[d]),W=h.useCallback(()=>{k(null),P(null),E(null),w("idle")},[]),ie=h.useCallback(async()=>{if(!(!N||!C)){if(u){V(!0);try{const{getStorage:ee,ref:fe,uploadBytesResumable:R}=await import("firebase/storage"),se=ee(),_e=C.name.slice(C.name.lastIndexOf("."))||".xlsx",Se=C.name.replace(/\.[^.]+$/,""),ge=fe(se,`${u}/${Se}_${Date.now()}${_e}`);await new Promise((le,he)=>{R(ge,C).on("state_changed",null,he,le)})}catch(ee){F(ee instanceof Error?ee.message:"Error desconocido"),V(!1);return}V(!1)}n(N.filasValidas,C),B()}},[N,C,u,n,B]),re=N!=null&&N.totalErrores===0&&N.totalFilas>0,ae=z1[y],me=T?"Subiendo…":"Subir Excel";return r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`${Z.backdrop} ${p?Z.visible:""}`,role:"dialog","aria-modal":!0,"aria-label":o,children:r.jsxs("div",{className:`${Z.modal} ${p?Z.visible:""}`,children:[r.jsxs("div",{className:Z.encabezado,children:[r.jsxs("div",{className:Z.encabezado_textos,children:[r.jsx("h2",{className:Z.titulo,children:o}),a&&r.jsx("p",{className:Z.subtitulo,children:a})]}),r.jsx("button",{className:Z.boton_cerrar,"aria-label":"Cerrar",onClick:B,type:"button",children:r.jsx(g1,{size:14})})]}),r.jsx("div",{className:Z.pasos,"aria-label":"Pasos del proceso",children:F1.map(({label:ee,Icono:fe},R)=>{const se=R===ae,_e=R<ae;return r.jsxs("div",{className:`${Z.paso} ${se?Z.activo:""} ${_e?Z.completado:""}`,children:[r.jsx("div",{className:Z.paso_circulo,"aria-hidden":!0,children:_e?r.jsx(cl,{size:15}):r.jsx(fe,{size:22})}),r.jsx("div",{className:Z.paso_etiqueta_grupo,children:r.jsx("span",{className:Z.paso_etiqueta,children:ee})})]},ee)})}),r.jsx("hr",{className:Z.divisor}),r.jsx("div",{className:Z.cuerpo,style:{paddingTop:"1rem",paddingBottom:"0.5rem"},children:r.jsxs("div",{className:Z.paso_contenido,children:[y==="idle"&&r.jsx(L1,{campos:e,plantillaUrl:i,plantillaFilename:s,generarPlantilla:l,onGenerarPlantilla:c,archivo:C,arrastrandoSobre:z,inputId:D,filtroNombre:d,onDragOver:U,onDragLeave:L,onDrop:j,onClickZona:()=>I.current?.click()}),y==="procesando"&&r.jsx(A1,{nombre:C?.name??""}),y==="resultado"&&N&&r.jsx(D1,{resultado:N,campos:e,identificadores:g})]},y)}),r.jsxs("div",{className:Z.pie,children:[O&&r.jsxs("div",{className:Z.alerta_inline,role:"alert",children:[r.jsx(dl,{size:16}),r.jsx("span",{children:O})]}),y==="idle"&&r.jsx(Ze,{variant:"solid",color:"primary",size:"sm",isDisabled:!C,onClick:()=>C&&X(C),children:"Validar archivo"}),y==="resultado"&&N&&r.jsxs(r.Fragment,{children:[N.totalErrores>0&&r.jsx(Ze,{variant:"outline",color:"default",size:"sm",startContent:r.jsx(m1,{size:16}),isDisabled:T,onClick:W,children:"Reintentar"}),re&&r.jsx(Ze,{variant:"solid",color:"primary",size:"sm",startContent:T?void 0:r.jsx(cl,{size:13}),isDisabled:T,onClick:()=>m?b(!0):void ie(),children:me})]})]})]})}),m&&r.jsx(Xn,{isOpen:S,tipo:"advertencia",titulo:m.titulo??"Confirmar importación",mensaje:m.mensaje??"¿Deseas continuar con la importación?",descripcion:m.descripcion,textoConfirmar:"Sí, importar",textoCancelar:"Revisar",onConfirmar:()=>{b(!1),ie()},onCancelar:()=>b(!1)}),x!==null&&r.jsx(Xn,{isOpen:!0,tipo:"eliminar",icono:r.jsx(ul,{size:22}),titulo:"No se pudo subir el archivo",mensaje:"Ocurrió un error al guardar el archivo en el servidor.",descripcion:x,textoConfirmar:"Reintentar",textoCancelar:"Cancelar",onConfirmar:()=>{F(null),ie()},onCancelar:()=>F(null)})]})}const Yo=e=>e.trim().toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,""),B1=(e,n)=>{const t=Yo(n);return Object.entries(e).find(([a])=>Yo(a)===t)?.[1]??""},j1=e=>(n,t)=>n?.trim()?null:e??"Este campo es requerido",q1=(e,n)=>(t,o)=>{const a=t?.trim();return e.includes(a)?null:n??`Valor no válido — opciones válidas: ${e.join(", ")}`},H1=(e,n)=>(t,o)=>{const a=Yo(t??"");return e.map(Yo).includes(a)?null:n??`Valor no válido — opciones válidas: ${e.join(", ")}`},W1=e=>(n,t)=>{const o=n?.trim();return o&&isNaN(Number(o))?e??"Debe ser un número":null},G1=e=>(n,t)=>{const o=n?.trim();return o&&!Number.isInteger(Number(o))?e??"Debe ser un número entero":null},Z1=e=>Jo(/^\d+$/,e??"Solo se permiten dígitos"),U1=(e,n)=>(t,o)=>(t?.trim()??"").length>e?n??`No puede superar ${e} caracteres`:null,K1=(e,n)=>(t,o)=>{const a=t?.trim()??"";return a.length>0&&a.length<e?n??`Debe tener al menos ${e} caracteres`:null},Jo=(e,n)=>(t,o)=>{const a=t?.trim();return a&&!e.test(a)?n??"Formato inválido":null},X1=e=>Jo(/^[^\s@]+@[^\s@]+\.[^\s@]+$/,e??"Correo electrónico inválido"),Y1=e=>Jo(/^[a-zA-ZÀ-ÿñÑ\s]+$/,e??"Solo se permiten letras"),J1=(e,n,t)=>(o,a)=>{const i=o?.trim();if(!i)return null;const s=Number(i);return isNaN(s)?"Debe ser un número":s<e||s>n?t??`Debe estar entre ${e} y ${n}`:null},In=e=>{const n=e?.trim();if(!n)return null;const t=n.match(/^(\d{1,2})[/-](\d{1,2})[/-](\d{4})$/);if(t){const i=new Date(Number(t[3]),Number(t[2])-1,Number(t[1]));if(!isNaN(i.getTime()))return i}const o=n.match(/^(\d{4})[/-](\d{1,2})[/-](\d{1,2})$/);if(o){const i=new Date(Number(o[1]),Number(o[2])-1,Number(o[3]));if(!isNaN(i.getTime()))return i}const a=new Date(n);return isNaN(a.getTime())?null:a},Q1=e=>(n,t)=>{const o=n?.trim();return o&&In(o)===null?e??"Fecha inválida":null},R1=e=>(n,t)=>{const o=n?.trim();if(!o)return null;const a=In(o);return a&&a>new Date?e??"La fecha no puede ser futura":null},ep=(e=18,n)=>(t,o)=>{const a=t?.trim();if(!a)return null;const i=In(a);if(!i)return null;const s=new Date;return s.getFullYear()-i.getFullYear()-(s<new Date(s.getFullYear(),i.getMonth(),i.getDate())?1:0)<e?n??`La edad mínima es ${e} años`:null},tp=(e,n)=>(t,o)=>{const a=t?.trim();if(!a)return null;const i=In(a);if(!i)return null;const s=B1(o,e);if(!s)return null;const l=In(s);return l&&i<=l?n??`Debe ser posterior a "${e}"`:null},np=(e,n,t)=>(o,a)=>{const i=o?.trim();if(!i)return null;const s=In(i);if(!s)return null;const l=s.getFullYear();return l<e||l>n?t??`El año debe estar entre ${e} y ${n}`:null},op=(...e)=>(n,t)=>{for(const o of e){const a=o(n,t);if(a!==null)return a}return null};J.Badge=$a,J.BadgeVoz=ur,J.Boton=Ze,J.Checkbox=En,J.CheckboxGroup=Ms,J.ContextMenu=Ys,J.Drawer=Ws,J.DropdownContext=pa,J.DropdownMenu=Ko,J.ExcelImport=V1,J.FileStage=s1,J.FileViewer=u1,J.GrabacionIcono=Pa,J.GroupButton=Of,J.IconoCerrar=Js,J.IconoDerecha=tl,J.IconoFiltroAplicar=Qs,J.IconoFiltroLimpiar=Rs,J.IconoIzquierda=el,J.InputDate=Da,J.InputNumeric=Aa,J.InputText=Ma,J.MenuItem=ha,J.MenuList=Uo,J.MicrofonoIcono=cr,J.Modal=fa,J.ModalAviso=Xn,J.ModalStack=Lf,J.PanelFiltros=Bf,J.Radio=_a,J.RadioGroup=Hs,J.Select=gs,J.Signature=Ea,J.SonidoIcono=dr,J.Submenu=ma,J.TablaDatos=$f,J.TextArea=Oa,J.Toggle=ir,J.Tooltip=_n,J.Transicion=oo,J.anioEnRango=np,J.combinar=op,J.correoElectronico=X1,J.edadMinima=ep,J.esCheckbox=Gs,J.esEntero=G1,J.esFechaValida=Q1,J.esLabel=Ks,J.esNumero=W1,J.esRadio=Zs,J.esSeparador=Us,J.expresionRegular=Jo,J.fechaEnRango=ec,J.fechaPosteriorA=tp,J.formatearFecha=lr,J.formatearNumero=zn,J.generarOpcionesAleatorias=Iu,J.generarUsuariosPrueba=Fu,J.leerArchivoExcel=fl,J.longitudMaxima=U1,J.longitudMinima=K1,J.noFechaFutura=R1,J.obtenerFechaHoy=Rl,J.parsearNumero=Ia,J.procesarValidacion=Fa,J.rangoNumerico=J1,J.redondearDecimales=za,J.requerido=j1,J.restringirRango=sr,J.soloLetras=Y1,J.soloNumeros=Z1,J.tieneHijos=Yn,J.unoDeLosSiguientes=q1,J.unoDeLosSiguientesNormalizado=H1,J.useCheckboxGroupContext=Es,J.useDropdownContext=ga,J.useReconocimientoVoz=Ta,J.useTablaContext=D_,J.useTablaContextSafe=tn,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})}));
29
29
  //# sourceMappingURL=index.umd.cjs.map