1import{j as s,cB as x}from"./index-DdokvTmJ.js";import{r as j}from"./lucide-icons-DcjOfOJe.js";const f=" a ",h=/^(\d{2})\/(\d{2})\/(\d{4})$/;function d(a){const e=a.trim().match(h);return e?`${e[3]}-${e[2]}-${e[1]}`:""}function p(a){const[e,t,i]=a.split("-");return e&&t&&i?`${i}/${t}/${e}`:""}function v(a){var r;const e=a.trim();if(!e)return{inicio:"",fim:"",legado:""};const t=e.split(f).map(l=>l.trim()),i=d((r=t[0])!=null?r:""),n=t.length>1?d(t[1]):"";return i!==""&&(t.length===1||n!=="")?{inicio:i,fim:n,legado:""}:{inicio:"",fim:"",legado:e}}function u(a,e){const t=p(a);if(!t)return"";const i=p(e);return i?`${t}${f}${i}`:t}const g=({value:a,onChange:e,disabled:t=!1,label:i,required:n=!1})=>{const m=typeof a=="string"?a:"",{inicio:r,fim:l,legado:o}=j.useMemo(()=>v(m),[m]);return s.jsxs("div",{className:"flex w-full flex-col gap-1.5",children:[i&&s.jsxs("div",{className:"inline-flex min-h-[20px] items-center gap-1",children:[s.jsx("label",{className:"font-medium text-[var(--text-1)] text-sm",children:i}),n&&s.jsx("span",{className:"font-medium text-[var(--brand)] text-sm",children:"*"})]}),s.jsxs("div",{className:"flex w-full items-center gap-2",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx(x,{value:r,onChange:c=>e==null?void 0:e(u(c!=null?c:"",l)),placeholder:"dd/mm/aaaa",disabled:t,permiteDigitar:!0,permiteLimpar:!0})}),s.jsx("span",{className:"shrink-0 text-sm text-[var(--text-3)]",children:"a"}),s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx(x,{value:l,onChange:c=>e==null?void 0:e(u(r,c!=null?c:"")),placeholder:"dd/mm/aaaa",disabled:t||!r,permiteDigitar:!0,permiteLimpar:!0,mesInicial:r})})]}),o&&s.jsxs("span",{className:"text-[11px] leading-tight text-[var(--text-3)]",children:["Valor atual: ",s.jsx("span",{className:"font-medium",children:o})," â substituÃdo ao escolher as datas."]})]})};export{g as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.