1import{i as x,r as g,t as u}from"./react-C6JdJxIB.js";import{t as p}from"./jsx-runtime-CGXBp6bb.js";import{t as r}from"./trans-PZ_OsZUf.js";var j=g({default:()=>b}),v=x(u(),1),e=p();function b({isOpen:i,onClose:a,title:l,form:t,languages:o,onSubmit:n,contextLocked:d}){return i?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"fixed inset-0 bg-black/40 z-40",onClick:a}),(0,e.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:(0,e.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-2xl overflow-hidden",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100",children:[(0,e.jsx)("h2",{className:"font-semibold text-gray-800 text-base",children:l}),(0,e.jsx)("button",{type:"button",onClick:a,className:"text-gray-400 hover:text-gray-600 transition-colors",children:(0,e.jsx)("i",{className:"ti ti-x text-lg"})})]}),(0,e.jsxs)("form",{onSubmit:n,className:"p-6 space-y-4",children:[(0,e.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("label",{className:"block text-xs font-semibold text-gray-500 mb-1",children:["Key ",(0,e.jsx)("span",{className:"text-rose-500",children:"*"})]}),(0,e.jsx)("input",{type:"text",value:t.data.key,onChange:s=>t.setData("key",s.target.value),placeholder:"nav.home",disabled:!!t.data.id,className:"w-full rounded-xl border border-gray-200 bg-gray-50 px-4 py-2.5 text-sm font-mono focus:border-indigo-400 focus:bg-white focus:outline-none focus:ring-2 focus:ring-indigo-100 transition-colors disabled:opacity-60"}),t.errors.key&&(0,e.jsx)("p",{className:"mt-1 text-xs text-rose-500",children:t.errors.key})]}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("label",{className:"block text-xs font-semibold text-gray-500 mb-1",children:["Group ",(0,e.jsx)("span",{className:"text-rose-500",children:"*"})]}),(0,e.jsx)("input",{type:"text",value:t.data.group,onChange:s=>t.setData("group",s.target.value),placeholder:"general",className:"w-full rounded-xl border border-gray-200 bg-gray-50 px-4 py-2.5 text-sm focus:border-indigo-400 focus:bg-white focus:outline-none focus:ring-2 focus:ring-indigo-100 transition-colors"}),t.errors.group&&(0,e.jsx)("p",{className:"mt-1 text-xs text-rose-500",children:t.errors.group})]})]}),!d&&(0,e.jsxs)("div",{children:[(0,e.jsx)("label",{className:"block text-xs font-semibold text-gray-500 mb-1",children:"Context"}),(0,e.jsx)("div",{className:"flex gap-3",children:["central","tenant"].map(s=>(0,e.jsxs)("label",{className:`flex items-center gap-2 px-4 py-2 rounded-xl border cursor-pointer text-sm font-medium transition-colors ${t.data.context===s?"border-indigo-400 bg-indigo-50 text-indigo-700":"border-gray-200 text-gray-600 hover:border-gray-300"}`,children:[(0,e.jsx)("input",{type:"radio",className:"hidden",value:s,checked:t.data.context===s,onChange:()=>t.setData("context",s)}),(0,e.jsx)("i",{className:`ti ti-${s==="central"?"building":"users"}`}),s.charAt(0).toUpperCase()+s.slice(1)]},s))})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("label",{className:"block text-xs font-semibold text-gray-500 mb-2",children:"Translations"}),(0,e.jsx)("div",{className:"space-y-2",children:o.map(s=>(0,e.jsxs)("div",{className:"flex items-start gap-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 pt-2.5 w-24 shrink-0",children:[(0,e.jsx)("span",{className:"text-base",children:s.flag??"ð"}),(0,e.jsx)("span",{className:"text-xs font-semibold text-gray-600 uppercase",children:s.code})]}),(0,e.jsx)("div",{className:"flex-1",children:(0,e.jsx)("input",{type:"text",dir:s.direction,value:t.data.values?.[s.code]??"",onChange:c=>t.setData("values",{...t.data.values,[s.code]:c.target.value}),placeholder:`${s.name} translation...`,className:"w-full rounded-xl border border-gray-200 bg-gray-50 px-4 py-2.5 text-sm focus:border-indigo-400 focus:bg-white focus:outline-none focus:ring-2 focus:ring-indigo-100 transition-colors"})})]},s.code))})]}),(0,e.jsxs)("div",{className:"flex items-center justify-end gap-3 pt-2 border-t border-gray-100",children:[(0,e.jsx)("button",{type:"button",onClick:a,className:"rounded-xl border border-gray-200 px-4 py-2 text-sm text-gray-600 hover:bg-gray-50 transition-colors",children:r("cancel")}),(0,e.jsx)("button",{type:"submit",disabled:t.processing,className:"rounded-xl bg-indigo-600 px-5 py-2 text-sm font-semibold text-white hover:bg-indigo-700 disabled:opacity-60 transition-colors",children:t.processing?r("saving"):r("save")})]})]})]})})]}):null}export{j as n,b as t};
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.