import{j as o}from"./app-Bup04Qnx.js";const x=a=>{const{type:l,children:t,btnLabel:n=null,openModalRef:e=null}=a,{btnClassName:r="btn btn-sm btn-primary",modalBoxSize:c="",backdrop:s=!1,onClick:m=null,modalBottom:d=!1,boxClassName:b="modal-box scrollbar-none overflow-visible"}=a;let{onBackdoorClick:i=null}=a;return!i&&m&&(i=()=>m(null)),o.jsxs(o.Fragment,{children:[n||e?o.jsx("label",{ref:e,htmlFor:`modal_${l}`,className:r,onClick:m,children:n}):null,o.jsx("input",{type:"checkbox",id:`modal_${l}`,className:"modal-toggle"}),o.jsxs("div",{className:`modal ${!!d&&"modal-bottom"}`,role:"dialog",children:[o.jsx("div",{className:`${b} ${c}`,children:t}),s?o.jsx("label",{htmlFor:`modal_${l}`,className:"modal-backdrop",onClick:i,children:"X"}):null]})]})},p=({onClick:a,id:l,btnLabel:t,className:n=null,disabled:e=!1,children:r=null})=>{l=l!=null&&l.startsWith("modal")?l:`modal_${l}`;const c=s=>{s.key==="Enter"&&s.target.click()};return o.jsx("label",{tabIndex:0,onKeyDown:c,htmlFor:e?null:l,id:`btn_${l}`,onClick:a,className:`${e&&"opacity-30"} ${n??"capitalize cursor-pointer text-start whitespace-pre"}`,children:r??t})};export{p as M,x as W};
