1import{j as e}from"./vendor-data-Z5doMMu-.js";import{b as he,r as m}from"./vendor-react-zNM0AU50.js";import{v as q}from"./visitService-DcwGr2oo.js";import{m as we}from"./index-D1K3lVhu.js";import{a7 as S,H as te,x as B,aa as _e,Z as me,K as Ce,A,c as ke,U as ue,n as se,g as Se,af as H,T as ae,ag as ge,a as re,X as G,an as Me,ai as De,i as $e,ac as ee}from"./vendor-ui-CW5bJ11U.js";import"./vendor-firebase-Da9KY1q_.js";import"./vendor-charts-08G1rM8P.js";function Ze(){he();const[d,j]=m.useState(!0),[h,p]=m.useState([]),[b,g]=m.useState([]),[r,t]=m.useState("records"),[o,x]=m.useState("list"),[u,i]=m.useState(""),[a,l]=m.useState("all"),[y,f]=m.useState("all"),[v,_]=m.useState("all"),[s,c]=m.useState("all"),[N,w]=m.useState(!1),[D,T]=m.useState(""),[$,Y]=m.useState(""),[be,W]=m.useState(!1),[E,K]=m.useState(null),[le,L]=m.useState(null),[je,ne]=m.useState(!1),[X,oe]=m.useState(null);m.useEffect(()=>{O()},[]);async function O(){try{j(!0);const[n,C]=await Promise.all([q.getAllVisits(),we.getMembers()]);p(n),g(C)}catch(n){console.error("ë°ì´í° ë¡ë© ì¤í¨:",n),S.error("ë°ì´í°ë¥¼ ë¶ë¬ì¬ ì ììµëë¤")}finally{j(!1)}}const I=m.useMemo(()=>{const n=new Map;return b.forEach(C=>n.set(C.id,C)),n},[b]),ye=m.useMemo(()=>{const n=new Set(b.map(C=>C.parish).filter(Boolean));return Array.from(n).sort()},[b]),fe=m.useMemo(()=>b.filter(n=>n.member_classification==="ìëì¶ìêµìì").map(n=>n.name).filter(Boolean).sort(),[b]),P=m.useMemo(()=>h.filter(n=>{const C=I.get(n.member_id),M=(C==null?void 0:C.name)||n.member_name||"";if(u){const U=u.toLowerCase();if(!M.toLowerCase().includes(U)&&!(n.purpose||"").toLowerCase().includes(U)&&!(n.content||"").toLowerCase().includes(U)&&!(n.visitors||[]).some(J=>J.toLowerCase().includes(U)))return!1}return!(a!=="all"&&n.visit_type!==a||y!=="all"&&(n.urgency||"ì¼ë°")!==y||N&&!n.follow_up_needed||D&&n.visit_date<D||$&&n.visit_date>$||v!=="all"&&(!C||C.parish!==v)||s!=="all"&&!(n.visitors||[]).includes(s))}),[h,I,u,a,y,N,D,$,v,s]),V={total:h.length,thisMonth:h.filter(n=>{const C=new Date(n.visit_date),M=new Date;return C.getMonth()===M.getMonth()&&C.getFullYear()===M.getFullYear()}).length,followUpNeeded:h.filter(n=>n.follow_up_needed).length,byType:{ê°ì ì¬ë°©:h.filter(n=>n.visit_type==="ê°ì ì¬ë°©").length,ë³ìì¬ë°©:h.filter(n=>n.visit_type==="ë³ìì¬ë°©").length,ì íì¬ë°©:h.filter(n=>n.visit_type==="ì íì¬ë°©").length,ìë´:h.filter(n=>n.visit_type==="ìë´").length}};async function Z(n){if(confirm("ì´ ì¬ë°© 기ë¡ì ìì íìê² ìµëê¹?"))try{await q.deleteVisit(n),S.success("ìì ëììµëë¤"),O()}catch{S.error("ìì ì ì¤í¨íìµëë¤")}}async function ce(n){try{await q.updateVisit(n,{follow_up_needed:!1}),S.success("íìì¡°ì¹ê° ìë£ëììµëë¤"),O()}catch{S.error("ì²ë¦¬ì ì¤í¨íìµëë¤")}}function R(n,C){if(n.length===0){S.error("ë´ë³´ë¼ ë°ì´í°ê° ììµëë¤");return}const M=n.map(k=>{var de,xe,pe;const F=I.get(k.member_id);return{êµì¸ëª :(F==null?void 0:F.name)||k.member_name||"-",ì§ë¶:(F==null?void 0:F.position)||((de=k.original_data)==null?void 0:de.position)||"-",êµêµ¬:(F==null?void 0:F.parish)||"-",ì¬ë°©ì¼ì:k.visit_date,ì¬ë°©ì í:k.visit_type,구ë¶:k.urgency||"ì¼ë°",ì¬ë°©ì:((xe=k.visitors)==null?void 0:xe.join(", "))||"-",ëíì:k.companion||"-",목ì :k.purpose,ì¥ì:k.location||"-",ë´ì©:k.content,ë§ì:k.scripture||"-",ì°¬ì¡:k.hymn||"-",기ëì 목:((pe=k.prayer_topics)==null?void 0:pe.join(", "))||"-",íìì¡°ì¹:k.follow_up_needed?"íì":"-",íìì¡°ì¹ìì ì¼:k.follow_up_date||"-"}}),U=Object.keys(M[0]),J=[U.join(","),...M.map(k=>U.map(F=>`"${k[F]||""}"`).join(","))].join(` 2`),ve=new Blob(["\uFEFF"+J],{type:"text/csv;charset=utf-8;"}),ie=URL.createObjectURL(ve),Q=document.createElement("a");Q.href=ie,Q.download=`${C}_${new Date().toISOString().split("T")[0]}.csv`,Q.click(),URL.revokeObjectURL(ie),S.success("ìì íì¼ì´ ë¤ì´ë¡ëëììµëë¤")}function Ne(n){oe(n),ne(!0)}return d?e.jsx("div",{className:"flex items-center justify-center h-96",children:e.jsx("div",{className:"text-gray-500 text-[13px]",children:"ë°ì´í°ë¥¼ ë¶ë¬ì¤ë ì¤..."})}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-[18px] font-bold text-gray-900 flex items-center gap-2",children:[e.jsx(te,{className:"w-5 h-5 text-blue-600"}),"ì¬ë°© ê´ë¦¬"]}),e.jsx("p",{className:"text-[12px] text-gray-500 mt-1",children:"ê°ì /ë³ì ì¬ë°© 기ë¡ê³¼ íµê³ë¥¼ ê´ë¦¬í©ëë¤"})]}),e.jsx("div",{className:"flex items-center gap-2",children:r==="records"&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>R(P,"ì¬ë°©ê¸°ë¡_ì ì²´"),className:"flex items-center gap-1.5 px-3 py-1.5 border border-gray-300 text-gray-700 rounded hover:bg-gray-50 transition-colors text-[13px] font-medium",children:[e.jsx(B,{className:"w-4 h-4"}),"ìì "]}),e.jsxs("button",{onClick:()=>W(!0),className:"flex items-center gap-1.5 px-3 py-1.5 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors text-[13px] font-medium",children:[e.jsx(_e,{className:"w-4 h-4"}),"ì¬ë°© ê¸°ë¡ ì¶ê°"]})]})})]}),e.jsxs("div",{className:"flex gap-1 bg-gray-100 p-1 rounded-lg w-fit",children:[e.jsx("button",{onClick:()=>t("records"),className:`px-4 py-2 rounded-md text-[13px] font-medium transition-all ${r==="records"?"bg-white text-blue-600 shadow-sm":"text-gray-500 hover:text-gray-700"}`,children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(me,{className:"w-4 h-4"}),"ì¬ë°©ê¸°ë¡"]})}),e.jsx("button",{onClick:()=>t("stats"),className:`px-4 py-2 rounded-md text-[13px] font-medium transition-all ${r==="stats"?"bg-white text-blue-600 shadow-sm":"text-gray-500 hover:text-gray-700"}`,children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(Ce,{className:"w-4 h-4"}),"íµê³"]})})]}),r==="records"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[e.jsx(z,{label:"ì ì²´ ì¬ë°©",value:V.total,color:"blue"}),e.jsx(z,{label:"ì´ë² ë¬",value:V.thisMonth,color:"green"}),e.jsx(z,{label:"íìì¡°ì¹",value:V.followUpNeeded,color:"orange",isAlert:V.followUpNeeded>0}),e.jsx(z,{label:"ê°ì ì¬ë°©",value:V.byType.ê°ì ì¬ë°©,color:"purple"})]}),V.followUpNeeded>0&&!N&&e.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded p-3",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(A,{className:"w-4 h-4 text-yellow-600 mt-0.5"}),e.jsx("div",{className:"flex-1",children:e.jsxs("h3",{className:"text-[13px] font-bold text-yellow-900",children:["íìì¡°ì¹ê° íìí ì¬ë°©: ",V.followUpNeeded,"ê±´"]})}),e.jsx("button",{onClick:()=>w(!0),className:"text-[12px] text-yellow-700 hover:text-yellow-900 font-medium",children:"보기 â"})]})}),e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-3",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-3 mb-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"보기 모ë"}),e.jsx("div",{className:"flex gap-1",children:[["list","목ë¡",me],["calendar","ìºë¦°ë",ke],["member","êµì¸ë³",ue],["visitor","êµììë³",se]].map(([n,C,M])=>e.jsxs("button",{onClick:()=>x(n),className:`flex-1 flex items-center justify-center gap-1 px-2 py-1.5 rounded text-[12px] transition-colors ${o===n?"bg-blue-600 text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:[e.jsx(M,{className:"w-3.5 h-3.5"}),C]},n))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ì¬ë°© ì í"}),e.jsxs("select",{value:a,onChange:n=>l(n.target.value),className:"compact-input",children:[e.jsx("option",{value:"all",children:"ì ì²´"}),e.jsx("option",{value:"ê°ì ì¬ë°©",children:"ê°ì ì¬ë°©"}),e.jsx("option",{value:"ë³ìì¬ë°©",children:"ë³ìì¬ë°©"}),e.jsx("option",{value:"ì íì¬ë°©",children:"ì íì¬ë°©"}),e.jsx("option",{value:"ìë´",children:"ìë´"}),e.jsx("option",{value:"ì´ì¬ì¬ë°©",children:"ì´ì¬ì¬ë°©"}),e.jsx("option",{value:"ì¶íì¬ë°©",children:"ì¶íì¬ë°©"}),e.jsx("option",{value:"ìë¡ì¬ë°©",children:"ìë¡ì¬ë°©"}),e.jsx("option",{value:"ìíì¬ë°©",children:"ìíì¬ë°©"}),e.jsx("option",{value:"ë±ë¡ì¬ë°©",children:"ë±ë¡ì¬ë°©"}),e.jsx("option",{value:"ì¥ê²°ìì¬ë°©",children:"ì¥ê²°ìì¬ë°©"}),e.jsx("option",{value:"구ììë°°",children:"구ììë°°"}),e.jsx("option",{value:"기í",children:"기í"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"구ë¶"}),e.jsxs("select",{value:y,onChange:n=>
2f(n.target.value),className:"compact-input",children:[e.jsx("option",{value:"all",children:"ì ì²´"}),e.jsx("option",{value:"ì¼ë°",children:"ì¼ë°"}),e.jsx("option",{value:"긴ê¸",children:"긴ê¸"}),e.jsx("option",{value:"ë¹ê³µê°",children:"ë¹ê³µê°"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"íìì¡°ì¹"}),e.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 border border-gray-300 rounded cursor-pointer hover:bg-gray-50",children:[e.jsx("input",{type:"checkbox",checked:N,onChange:n=>w(n.target.checked),className:"w-4 h-4"}),e.jsx("span",{className:"text-[12px]",children:"íìë§ ë³´ê¸°"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-5 gap-3 mb-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ììì¼"}),e.jsx("input",{type:"date",value:D,onChange:n=>T(n.target.value),className:"compact-input"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ì¢
ë£ì¼"}),e.jsx("input",{type:"date",value:$,onChange:n=>Y(n.target.value),className:"compact-input"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"êµêµ¬"}),e.jsxs("select",{value:v,onChange:n=>_(n.target.value),className:"compact-input",children:[e.jsx("option",{value:"all",children:"ì ì²´"}),ye.map(n=>e.jsx("option",{value:n,children:n},n))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"êµìì"}),e.jsxs("select",{value:s,onChange:n=>c(n.target.value),className:"compact-input",children:[e.jsx("option",{value:"all",children:"ì ì²´"}),fe.map(n=>e.jsx("option",{value:n,children:n},n))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ê²ì"}),e.jsxs("div",{className:"relative",children:[e.jsx(Se,{className:"absolute left-2 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400"}),e.jsx("input",{type:"text",placeholder:"ì´ë¦, 목ì , ë´ì©, ì¬ë°©ì...",value:u,onChange:n=>i(n.target.value),className:"compact-input pl-8"})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between text-[11px] text-gray-500",children:[e.jsxs("span",{children:["ì´ ",P.length,"ê±´ì ì¬ë°© 기ë¡"]}),(D||$||v!=="all"||s!=="all"||y!=="all"||a!=="all"||N||u)&&e.jsx("button",{onClick:()=>{T(""),Y(""),_("all"),c("all"),f("all"),l("all"),w(!1),i("")},className:"text-red-500 hover:text-red-700 font-medium",children:"íí° ì´ê¸°í"})]})]}),o==="list"?e.jsx(Fe,{visits:P,membersMap:I,onEdit:n=>L(n),onDelete:Z,onCompleteFollowUp:ce,onShowHistory:K}):o==="calendar"?e.jsx(Te,{visits:P,members:b}):o==="visitor"?e.jsx(Ve,{visits:P,membersMap:I,members:b,onEdit:n=>L(n),onDelete:Z,onCompleteFollowUp:ce,exportToExcel:R}):e.jsx(Ee,{visits:P,members:b,onSelectMember:K})]}):e.jsx(Oe,{visits:h,members:b,exportToExcel:R}),be&&e.jsx(Ue,{members:b,onClose:()=>W(!1),onSuccess:n=>{n||W(!1),O()}}),E&&e.jsx(Ye,{memberId:E,member:b.find(n=>n.id===E),visits:h.filter(n=>n.member_id===E),onClose:()=>K(null),onEdit:n=>L(n),onDelete:Z,onPrint:()=>Ne(E),onExport:()=>{const n=h.filter(M=>M.member_id===E),C=b.find(M=>M.id===E);R(n,`ì¬ë°©ê¸°ë¡_${(C==null?void 0:C.name)||""}`)}}),le&&e.jsx(Pe,{visit:le,members:b,onClose:()=>L(null),onSuccess:()=>{L(null),O()}}),je&&X&&e.jsx(Le,{member:b.find(n=>n.id===X),visits:h.filter(n=>n.member_id===X),onClose:()=>{ne(!1),oe(null)}})]})}function z({label:d,value:j,color:h,isAlert:p}){return e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-3",children:[e.jsxs("div",{className:"text-[22px] font-bold text-gray-900 flex items-center gap-2",children:[j,p&&j>0&&e.jsx(A,{className:"w-4 h-4 text-orange-500"})]}),e.jsx("div",{className:"text-[11px] text-gray-500",children:d})]})}function Fe({visits:d,membersMap:j,onEdit:h,onDelete:p,onCompleteFollowUp:b,onShowHistory:g}){const r={ê°ì ì¬ë°©:"bg-blue-50 text-blue-700",ë³ìì¬ë°©:"bg-red-50 text-red-700",ì íì¬ë°©:"bg-green-50 text-green-700",ìë´:"bg-blue-50 text-blue-700",ì´ì¬ì¬ë°©:"bg-yellow-50 text-yellow-700",ì¶íì¬ë°©:"bg-blue-50 text-blue-700",ìë¡ì¬ë°©:"bg-blue-50 text-blue-700",ìíì¬ë°©:"bg-blue-50 text-blue-700",ë±ë¡ì¬ë°©:"bg-lime-50 text-lime-700",ì¥ê²°ìì¬ë°©:"bg-
2amber-50 text-amber-700",구ììë°°:"bg-orange-50 text-orange-700",기í:"bg-gray-100 text-gray-600"};return d.length===0?e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-12 text-center",children:[e.jsx(te,{className:"w-12 h-12 text-gray-300 mx-auto mb-3"}),e.jsx("p",{className:"text-[13px] text-gray-500",children:"ì¬ë°© 기ë¡ì´ ììµëë¤"})]}):e.jsx("div",{className:"bg-white border border-gray-200 rounded shadow-sm overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-[12px]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-gray-50 border-b border-gray-200",children:[e.jsx("th",{className:"text-left p-2 font-bold text-gray-700 whitespace-nowrap",children:"ì¬ë°©ì¼ì"}),e.jsx("th",{className:"text-left p-2 font-bold text-gray-700 whitespace-nowrap",children:"êµì¸ëª
"}),e.jsx("th",{className:"text-left p-2 font-bold text-gray-700 whitespace-nowrap",children:"ì§ë¶"}),e.jsx("th",{className:"text-left p-2 font-bold text-gray-700 whitespace-nowrap",children:"êµêµ¬"}),e.jsx("th",{className:"text-left p-2 font-bold text-gray-700 whitespace-nowrap",children:"ì¬ë°©ì í"}),e.jsx("th",{className:"text-left p-2 font-bold text-gray-700 whitespace-nowrap",children:"구ë¶"}),e.jsx("th",{className:"text-left p-2 font-bold text-gray-700 whitespace-nowrap",children:"ì¬ë°©ì"}),e.jsx("th",{className:"text-left p-2 font-bold text-gray-700 whitespace-nowrap",children:"목ì "}),e.jsx("th",{className:"text-left p-2 font-bold text-gray-700 whitespace-nowrap max-w-[200px]",children:"ë´ì©"}),e.jsx("th",{className:"text-center p-2 font-bold text-gray-700 whitespace-nowrap",children:"íì"}),e.jsx("th",{className:"text-center p-2 font-bold text-gray-700 whitespace-nowrap",children:"ê´ë¦¬"})]})}),e.jsx("tbody",{children:d.map(t=>{var a,l;const o=j.get(t.member_id),x=(o==null?void 0:o.name)||t.member_name||"-",u=(o==null?void 0:o.position)||((a=t.original_data)==null?void 0:a.position)||"-",i=(o==null?void 0:o.parish)||"-";return e.jsxs("tr",{className:"border-t border-gray-100 hover:bg-blue-50/30 cursor-pointer",onClick:()=>h(t),children:[e.jsx("td",{className:"p-2 whitespace-nowrap text-gray-900",children:t.visit_date}),e.jsx("td",{className:"p-2 whitespace-nowrap font-medium text-gray-900",children:x}),e.jsx("td",{className:"p-2 whitespace-nowrap text-gray-500",children:u}),e.jsx("td",{className:"p-2 whitespace-nowrap text-gray-500",children:i}),e.jsx("td",{className:"p-2 whitespace-nowrap",children:e.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${r[t.visit_type]||"bg-gray-100 text-gray-600"}`,children:t.visit_type})}),e.jsxs("td",{className:"p-2 whitespace-nowrap",children:[t.urgency==="긴ê¸"&&e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-red-100 text-red-700",children:"긴ê¸"}),t.urgency==="ë¹ê³µê°"&&e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-200 text-gray-600",children:"ë¹ê³µê°"}),(!t.urgency||t.urgency==="ì¼ë°")&&e.jsx("span",{className:"text-gray-400",children:"-"})]}),e.jsx("td",{className:"p-2 whitespace-nowrap text-gray-600 text-[11px]",children:((l=t.visitors)==null?void 0:l.join(", "))||"-"}),e.jsx("td",{className:"p-2 text-gray-600 max-w-[150px] truncate",children:t.purpose||"-"}),e.jsx("td",{className:"p-2 text-gray-500 max-w-[200px] truncate",children:t.content||"-"}),e.jsx("td",{className:"p-2 text-center",children:t.follow_up_needed?e.jsx("button",{onClick:y=>{y.stopPropagation(),b(t.id)},className:"text-orange-500 hover:text-green-600",title:"íìì¡°ì¹ ìë£ ì²ë¦¬",children:e.jsx(A,{className:"w-4 h-4"})}):e.jsx("span",{className:"text-gray-300",children:"-"})}),e.jsx("td",{className:"p-2 text-center",children:e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[e.jsx("button",{onClick:y=>{y.stopPropagation(),h(t)},className:"text-blue-500 hover:text-blue-700",title:"ìì ",children:e.jsx(H,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:y=>{y.stopPropagation(),p(t.id)},className:"text-red-400 hover:text-red-600",title:"ìì ",children:e.jsx(ae,{className:"w-3.5 h-3.5"})})]})})]},t.id)})})]})})})}function Te({visits:d,members:j}){const h=new Date,[p,b]=m.useState(h.getFullYear()),[g,r]=m.useState(h.getMonth()),[t,o]=m.useState(null),x=new Date(p,g,1).getDay(),u=new Date(p,g+1,0).getDate(),i=`${p}-${String(g+1).padStart(2,"0")}`,a=m.useMemo(()=>{const s={};return d.forEach(c=>{if(c.visit_date.startsWith(i)){const N=parseInt(c.visit_date.split("-")[2]);s[N]||(s[N]=[]),s[N].push(c)}}),s},[d,i]),l=Object.values(a).reduce((s,c)=>s+c.length,0);function y(){g===0?(b(p-1),r(11)):r(g-1),o(null)}function f(){g===11?(b(p+1),r(0)):r(g+1),o(null)}const v=[];for(let s=0;s<x;
2s++)v.push(null);for(let s=1;s<=u;s++)v.push(s);for(;v.length%7!==0;)v.push(null);const _=t?a[t]||[]:[];return e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("button",{onClick:y,className:"p-2 hover:bg-gray-100 rounded transition-colors",children:e.jsx(ge,{className:"w-5 h-5 text-gray-600"})}),e.jsxs("div",{className:"text-center",children:[e.jsxs("h3",{className:"text-[16px] font-bold text-gray-900",children:[p,"ë
",g+1,"ì"]}),e.jsxs("p",{className:"text-[12px] text-gray-500",children:["ì¬ë°© ",l,"ê±´"]})]}),e.jsx("button",{onClick:f,className:"p-2 hover:bg-gray-100 rounded transition-colors",children:e.jsx(re,{className:"w-5 h-5 text-gray-600"})})]}),e.jsx("div",{className:"grid grid-cols-7 gap-1 mb-1",children:["ì¼","ì","í","ì","목","ê¸","í "].map((s,c)=>e.jsx("div",{className:`text-center text-[11px] font-bold py-1 ${c===0?"text-red-500":c===6?"text-blue-500":"text-gray-500"}`,children:s},s))}),e.jsx("div",{className:"grid grid-cols-7 gap-1",children:v.map((s,c)=>{var $;if(s===null)return e.jsx("div",{className:"h-16"},`e${c}`);const N=(($=a[s])==null?void 0:$.length)||0,w=p===h.getFullYear()&&g===h.getMonth()&&s===h.getDate(),D=t===s,T=c%7;return e.jsxs("div",{onClick:()=>o(s===t?null:s),className:`h-16 p-1 rounded cursor-pointer transition-all border ${D?"border-blue-600 bg-blue-50 shadow-sm":w?"border-blue-300 bg-blue-50":N>0?"border-gray-200 bg-gray-50 hover:bg-green-50 hover:border-green-200":"border-transparent hover:bg-gray-50"}`,children:[e.jsx("div",{className:`text-[12px] font-medium ${T===0?"text-red-500":T===6?"text-blue-500":"text-gray-700"} ${w?"font-bold":""}`,children:s}),N>0&&e.jsx("div",{className:"mt-1",children:e.jsxs("div",{className:`text-[10px] font-bold text-center rounded py-0.5 ${N>=3?"bg-blue-600 text-white":N>=2?"bg-green-200 text-green-800":"bg-green-100 text-green-700"}`,children:[N,"ê±´"]})})]},s)})}),t&&_.length>0&&e.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-200",children:[e.jsxs("h4",{className:"text-[13px] font-bold text-gray-900 mb-3",children:[g+1,"ì ",t,"ì¼ ì¬ë°© (",_.length,"ê±´)"]}),e.jsx("div",{className:"space-y-2",children:_.map(s=>{var D;const c=j.find(T=>T.id===s.member_id),N=(c==null?void 0:c.name)||s.member_name||"(ì´ë¦ ìì)",w={ê°ì ì¬ë°©:"bg-blue-100 text-blue-700",ë³ìì¬ë°©:"bg-red-100 text-red-700",ì íì¬ë°©:"bg-green-100 text-green-700",ìë´:"bg-blue-100 text-blue-700",ì´ì¬ì¬ë°©:"bg-cyan-100 text-cyan-700",ì¶íì¬ë°©:"bg-blue-100 text-blue-700",ìë¡ì¬ë°©:"bg-blue-100 text-blue-700",ìíì¬ë°©:"bg-blue-100 text-blue-700",ë±ë¡ì¬ë°©:"bg-lime-100 text-lime-700",ì¥ê²°ìì¬ë°©:"bg-amber-100 text-amber-700",구ììë°°:"bg-orange-100 text-orange-700",기í:"bg-gray-100 text-gray-700"};return e.jsxs("div",{className:"p-3 bg-gray-50 rounded border border-gray-200",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-[13px] font-bold text-gray-900",children:N}),e.jsx("span",{className:"text-[11px] text-gray-500",children:(c==null?void 0:c.position)||((D=s.original_data)==null?void 0:D.position)||""}),e.jsx("span",{className:`text-[10px] px-2 py-0.5 rounded font-medium ${w[s.visit_type]||w.기í}`,children:s.visit_type})]}),e.jsxs("div",{className:"text-[12px] text-gray-600",children:[s.visitors&&s.visitors.length>0&&e.jsxs("span",{children:["ì¬ë°©ì: ",s.visitors.join(", ")," | "]}),s.purpose]}),s.location&&e.jsxs("div",{className:"text-[11px] text-gray-500 mt-0.5",children:["ì¥ì: ",s.location]})]},s.id)})})]}),t&&_.length===0&&e.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-200 text-center text-[12px] text-gray-500 py-4",children:[g+1,"ì ",t,"ì¼ì ì¬ë°© 기ë¡ì´ ììµëë¤"]})]})}function Ee({visits:d,members:j,onSelectMember:h}){const p=he(),b=d.reduce((r,t)=>{const o=t.member_id||"unknown";return r[o]||(r[o]=[]),r[o].push(t),r},{}),g=Object.entries(b).map(([r,t])=>{var a,l,y;const o=j.find(f=>f.id===r),x=(o==null?void 0:o.name)||((a=t[0])==null?void 0:a.member_name)||"(ì´ë¦ ìì)",u=(o==null?void 0:o.position)||((y=(l=t[0])==null?void 0:l.original_data)==null?void 0:y.position)||"",i=t.reduce((f,v)=>(f[v.visit_type]=(f[v.visit_type]||0)+1,f),{});return{member:o,memberId:r,displayName:x,displayPosition:u,total:t.length,lastDate:t[0].visit_date||"",lastType:t[0].visit_type,visitTypes:i,hasFollowUp:t.some(f=>f.follow_up_needed)}}).sort((r,t)=>t.lastDate.localeCompare(r.lastDate));return g.length===0?e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-12 text-center",children:[e.jsx(ue,{className:"w-12 h-12 text-gray-300 mx-auto mb-3"}),e.jsx("p",{className:"text-[13px] text-gray-500",children:"ì¬ë°© 기ë¡ì´ ìë êµì¸ì´ ììµëë¤"})]}):e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"text-[12px] text-gray-500 mb-2",children:["ì¬ë°© 기ë¡ì´ ìë êµì¸: ",g.length,"ëª
"]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:g.map(r=>{const{member:t,memberId:o,displayName:x,displayPosition:u,total:i,lastDate:a,visitTypes:l,hasFollowUp:y}=r;return e.jsx("div",{onClick:()=>h(o),className:"bg-white border border-gray-200 rounded shadow-sm p-4 cursor-pointer hover:border-blue-600 hover:shadow-md transition-all",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{onClick:f=>{f.stopPropagation(),t&&p(`/members/${o}/edit`)},className:t?"cursor-pointer":"",title:t?"êµì ë¶ ë³´ê¸°":"ëëª¨ë° ì ì© ë©¤ë²",children:t!=null&&t.photo_url?e.jsx("img",{src:t.photo_url,alt:x,className:"w-12 h-12 rounded-full object-cover hover:ring-2 hover:ring-blue-600",onError:f=>{f.currentTarget.style.display="none"}}):e.jsx("div",{className:`w-12 h-12 rounded-full flex items-center justify-center text-[14px] font-bold ${t?"bg-gray-200 text-gray-600 hover:ring-2 hover:ring-blue-600":"bg-amber-100 text-amber-700"}`,children:x[0]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-[14px] font-bold text-gray-900",children:x}),!t&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 bg-amber-100 text-amber-700 rounded",children:"ë모ë°"}),y&&e.jsx(A,{className:"w-3.5 h-3.5 text-orange-500"})]}),e.jsx("p",{className:"text-[11px] text-gray-500",children:u}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-[11px]",children:[e.jsxs("span",{className:"text-blue-600 font-medium",children:["ì´ ",i,"í"]}),e.jsx("span",{className:"text-gray-400",children:"|"}),e.jsxs("span",{className:"text-gray-500",children:["ìµê·¼: ",a||"ë ì§ ìì"]})]}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:Object.entries(l).map(([f,v])=>e.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 bg-gray-100 text-gray-600 rounded",children:[f," ",v]},f))})]}),e.jsx(re,{className:"w-5 h-5 text-gray-400"})]})},o)})})]})}function Ve({visits:d,membersMap:j,members:h,onEdit:p,onDelete:b,onCompleteFollowUp:g,exportToExcel:r}
2){const[t,o]=m.useState(null),x=m.useMemo(()=>h.filter(l=>l.member_classification==="ìëì¶ìêµìì").map(l=>l.name).filter(Boolean),[h]),u=m.useMemo(()=>{const l={};return d.forEach(y=>{(y.visitors||[]).forEach(f=>{x.includes(f)&&(l[f]||(l[f]=[]),l[f].push(y))})}),l},[d,x]),i=m.useMemo(()=>{const l=new Date;return Object.entries(u).map(([y,f])=>{const v=f.filter(_=>{const s=new Date(_.visit_date);return s.getMonth()===l.getMonth()&&s.getFullYear()===l.getFullYear()}).length;return{name:y,total:f.length,thisMonth:v}}).sort((y,f)=>f.total-y.total)},[u]),a=m.useMemo(()=>t?u[t]||[]:d,[t,u,d]);return i.length===0?e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-12 text-center",children:[e.jsx(se,{className:"w-12 h-12 text-gray-300 mx-auto mb-3"}),e.jsx("p",{className:"text-[13px] text-gray-500",children:"ì¬ë°© 기ë¡ì´ ììµëë¤"})]}):e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"w-56 flex-shrink-0 space-y-1",children:[e.jsxs("div",{className:"text-[12px] text-gray-500 mb-2",children:["êµìì: ",i.length,"ëª
"]}),e.jsx("button",{onClick:()=>o(null),className:`w-full text-left px-3 py-2 rounded text-[12px] transition-colors ${t?"bg-white border border-gray-200 text-gray-700 hover:bg-gray-50":"bg-blue-600 text-white font-bold"}`,children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{children:"ì ì²´ 보기"}),e.jsxs("span",{className:`text-[11px] ${t?"text-gray-400":"text-white/80"}`,children:[d.length,"ê±´"]})]})}),i.map(({name:l,total:y,thisMonth:f})=>e.jsxs("button",{onClick:()=>o(l),className:`w-full text-left px-3 py-2 rounded text-[12px] transition-colors ${t===l?"bg-blue-600 text-white font-bold":"bg-white border border-gray-200 text-gray-700 hover:bg-gray-50"}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium truncate",children:l}),e.jsxs("span",{className:`text-[11px] ${t===l?"text-white/80":"text-blue-600 font-bold"}`,children:[y,"ê±´"]})]}),e.jsxs("div",{className:`text-[10px] mt-0.5 ${t===l?"text-white/60":"text-gray-400"}`,children:["ì´ë²ë¬ ",f,"ê±´"]})]},l))]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("div",{className:"text-[12px] text-gray-500",children:t?e.jsxs("span",{children:[e.jsx("span",{className:"font-bold text-gray-900",children:t})," êµììì ì¬ë°©ê¸°ë¡ (",a.length,"ê±´)"]}):e.jsxs("span",{children:["ì ì²´ ì¬ë°©ê¸°ë¡ (",a.length,"ê±´)"]})}),e.jsxs("button",{onClick:()=>r(a,`ì¬ë°©ê¸°ë¡_${t||"ì ì²´"}`),className:"flex items-center gap-1 px-3 py-1.5 bg-green-50 text-green-700 rounded text-[11px] hover:bg-green-100 transition-colors",children:[e.jsx(B,{className:"w-3.5 h-3.5"}),"ìì
"]})]}),e.jsx("div",{className:"bg-white border border-gray-200 rounded shadow-sm overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-[12px]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-gray-50 border-b border-gray-200",children:[e.jsx("th",{className:"text-left p-2 font-bold text-gray-700 whitespace-nowrap",children:"ì¬ë°©ì¼ì"}),e.jsx("th",{className:"text-left p-2 font-bold text-gray-700 whitespace-nowrap",children:"êµì¸ëª
"}),e.jsx("th",{className:"text-left p-2 font-bold text-gray-700 whitespace-nowrap",children:"ì§ë¶"}),e.jsx("th",{className:"text-left p-2 font-bold text-gray-700 whitespace-nowrap",children:"êµêµ¬"}),e.jsx("th",{className:"text-left p-2 font-bold text-gray-700 whitespace-nowrap",children:"ì¬ë°©ì í"}),e.jsx("th",{className:"text-left p-2 font-bold text-gray-700 whitespace-nowrap",children:"구ë¶"}),e.jsx("th",{className:"text-left p-2 font-bold text-gray-700 whitespace-nowrap",children:"ì¬ë°©ì"}),e.jsx("th",{className:"text-left p-2 font-bold text-gray-700 whitespace-nowrap",children:"목ì "}),e.jsx("th",{className:"text-left p-2 font-bold text-gray-700 whitespace-nowrap max-w-[200px]",children:"ë´ì©"}),e.jsx("th",{className:"text-center p-2 font-bold text-gray-700 whitespace-nowrap",children:"íì"}),e.jsx("th",{className:"text-center p-2 font-bold text-gray-700 whitespace-nowrap",children:"ê´ë¦¬"})]})}),e.jsx("tbody",{children:a.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:11,className:"text-center py-8 text-gray-400",children:"ì¬ë°© 기ë¡ì´ ììµëë¤"})}
2):a.map(l=>{var c,N;const y=j.get(l.member_id),f=(y==null?void 0:y.name)||l.member_name||"-",v=(y==null?void 0:y.position)||((c=l.original_data)==null?void 0:c.position)||"-",_=(y==null?void 0:y.parish)||"-",s={ê°ì ì¬ë°©:"bg-blue-50 text-blue-700",ë³ìì¬ë°©:"bg-red-50 text-red-700",ì íì¬ë°©:"bg-green-50 text-green-700",ìë´:"bg-blue-50 text-blue-700",ì´ì¬ì¬ë°©:"bg-yellow-50 text-yellow-700",ì¶íì¬ë°©:"bg-blue-50 text-blue-700",ìë¡ì¬ë°©:"bg-blue-50 text-blue-700",구ììë°°:"bg-blue-50 text-blue-700"};return e.jsxs("tr",{className:"border-t border-gray-100 hover:bg-blue-50/30 cursor-pointer",onClick:()=>p(l),children:[e.jsx("td",{className:"p-2 whitespace-nowrap text-gray-900",children:l.visit_date}),e.jsx("td",{className:"p-2 whitespace-nowrap font-medium text-gray-900",children:f}),e.jsx("td",{className:"p-2 whitespace-nowrap text-gray-500",children:v}),e.jsx("td",{className:"p-2 whitespace-nowrap text-gray-500",children:_}),e.jsx("td",{className:"p-2 whitespace-nowrap",children:e.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${s[l.visit_type]||"bg-gray-100 text-gray-600"}`,children:l.visit_type})}),e.jsxs("td",{className:"p-2 whitespace-nowrap",children:[l.urgency==="긴ê¸"&&e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-red-100 text-red-700",children:"긴ê¸"}),l.urgency==="ë¹ê³µê°"&&e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-200 text-gray-600",children:"ë¹ê³µê°"}),(!l.urgency||l.urgency==="ì¼ë°")&&e.jsx("span",{className:"text-gray-400",children:"-"})]}),e.jsx("td",{className:"p-2 whitespace-nowrap text-gray-600 text-[11px]",children:((N=l.visitors)==null?void 0:N.join(", "))||"-"}),e.jsx("td",{className:"p-2 text-gray-600 max-w-[150px] truncate",children:l.purpose||"-"}),e.jsx("td",{className:"p-2 text-gray-500 max-w-[200px] truncate",children:l.content||"-"}),e.jsx("td",{className:"p-2 text-center",children:l.follow_up_needed?e.jsx("button",{onClick:w=>{w.stopPropagation(),g(l.id)},className:"text-orange-500 hover:text-green-600",title:"íìì¡°ì¹ ìë£ ì²ë¦¬",children:e.jsx(A,{className:"w-4 h-4"})}):e.jsx("span",{className:"text-gray-300",children:"-"})}),e.jsx("td",{className:"p-2 text-center",children:e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[e.jsx("button",{onClick:w=>{w.stopPropagation(),p(l)},className:"text-blue-500 hover:text-blue-700",title:"ìì ",children:e.jsx(H,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:w=>{w.stopPropagation(),b(l.id)},className:"text-red-400 hover:text-red-600",title:"ìì ",children:e.jsx(ae,{className:"w-3.5 h-3.5"})})]})})]},l.id)})})]})})})]})]})}function Ue({members:d,onClose:j,onSuccess:h}){const[p,b]=m.useState(!1),[g,r]=m.useState(!1),[t,o]=m.useState(""),[x,u]=m.useState(!1),i=m.useRef(null),[a,l]=m.useState({member_id:"",visit_date:new Date().toISOString().split("T")[0],visit_type:"ê°ì ì¬ë°©",urgency:"ì¼ë°",visitors:"",companion:"",purpose:"",content:"",location:"",scripture:"",hymn:"",prayer_topics:"",follow_up_needed:!1,follow_up_date:""}),y=m.useMemo(()=>{if(!t)return d.slice(0,50);const s=t.toLowerCase();return d.filter(c=>c.name.toLowerCase().includes(s)||(c.position||"").toLowerCase().includes(s))},[d,t]);m.useEffect(()=>{function s(c){i.current&&!i.current.contains(c.target)&&u(!1)}return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]);function f(){l({member_id:"",visit_date:new Date().toISOString().split("T")[0],visit_type:a.visit_type,urgency:a.urgency,visitors:a.visitors,companion:"",purpose:"",content:"",location:"",scripture:"",hymn:"",prayer_topics:"",follow_up_needed:!1,follow_up_date:""}),o("")}async function v(s){if(s.preventDefault(),!a.member_id||!a.purpose||!a.content){S.error("íì í목ì ì ë ¥íì¸ì");return}try{b(!0),await q.addVisit({member_id:a.member_id,visit_date:a.visit_date,visit_type:a.visit_type,urgency:a.urgency||"ì¼ë°",visitors:a.visitors.split(",").map(c=>c.trim()).filter(c=>c),companion:a.companion.trim()||void 0,purpose:a.purpose,content:a.content,location:a.location.trim()||void 0,scripture:a.scripture.trim()||void 0,hymn:a.hymn.trim()||void 0,prayer_topics:a.prayer_topics?a.prayer_topics.split(` 3`).map(c=>c.trim()).filter(c=>c):void 0,follow_up_needed:a.follow_up_needed,follow_up_date:a.follow_up_needed?a.follow_up_date:void 0}),g?(S.success("ì¶ê°ë¨! ê³ì ì ë ¥íì¸ì."),f(),h(!0)):(S.success("ì¬ë°© 기ë¡ì´ ì¶ê°ëììµëë¤"),h(!1))}catch{S.error("ì¶ê°ì ì¤í¨íìµëë¤")}finally{b(!1)}}const _=d.find(s=>s.id===a.member_id);return e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-xl w-full max-h-[90vh] overflow-y-auto",children:[e.jsxs("div",{className:"p-4 border-b border-gray-200 flex items-center justify-between",children:[e.jsx("h2",{className:"text-[16px] font-bold text-gray-900",children:"ì¬ë°© ê¸°ë¡ ì¶ê°"}),e.jsx("button",{onClick:j,className:"p-1 hover:bg-gray-100 rounded",children:e.jsx(G,{className:"w-5 h-5 text-gray-500"})})]}),e.jsxs("form",{onSubmit:v,className:"p-4 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{ref:i,className:"relative",children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["êµì¸ ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:t,onChange:s=>{o(s.target.value),u(!0),l({...a,member_id:""})},onFocus:()=>u(!0),className:"compact-input",placeholder:"ì´ë¦ì ì ë ¥íì¸ì"}),_&&e.jsxs("div",{className:"text-[10px] text-green-600 mt-0.5 flex items-center gap-1",children:[e.jsx("span",{children:"â"})," ",_.name," (",_.position,")"]}),x&&e.jsx("div",{className:"absolute z-20 w-full mt-1 bg-white border border-gray-200 rounded shadow-lg max-h-48 overflow-y-auto",children:y.length===0?e.jsx("div",{className:"px-3 py-2 text-[12px] text-gray-500",children:"ê²ì ê²°ê
3³¼ ìì"}):y.map(s=>e.jsxs("div",{onClick:()=>{l({...a,member_id:s.id}),o(s.name),u(!1)},className:`px-3 py-2 text-[12px] cursor-pointer hover:bg-green-50 transition-colors ${a.member_id===s.id?"bg-green-50 text-green-700 font-medium":"text-gray-700"}`,children:[s.name," ",e.jsxs("span",{className:"text-gray-400",children:["(",s.position,")"]})]},s.id))})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ì¬ë°© ì í ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs("select",{value:a.visit_type,onChange:s=>l({...a,visit_type:s.target.value}),className:"compact-input",children:[e.jsx("option",{value:"ê°ì ì¬ë°©",children:"ê°ì ì¬ë°©"}),e.jsx("option",{value:"ë³ìì¬ë°©",children:"ë³ìì¬ë°©"}),e.jsx("option",{value:"ì íì¬ë°©",children:"ì íì¬ë°©"}),e.jsx("option",{value:"ìë´",children:"ìë´"}),e.jsx("option",{value:"ì´ì¬ì¬ë°©",children:"ì´ì¬ì¬ë°©"}),e.jsx("option",{value:"ì¶íì¬ë°©",children:"ì¶íì¬ë°©"}),e.jsx("option",{value:"ìë¡ì¬ë°©",children:"ìë¡ì¬ë°©"}),e.jsx("option",{value:"ìíì¬ë°©",children:"ìíì¬ë°©"}),e.jsx("option",{value:"ë±ë¡ì¬ë°©",children:"ë±ë¡ì¬ë°©"}),e.jsx("option",{value:"ì¥ê²°ìì¬ë°©",children:"ì¥ê²°ìì¬ë°©"}),e.jsx("option",{value:"구ììë°°",children:"구ììë°°"}),e.jsx("option",{value:"기í",children:"기í"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ì¬ë°© ë ì§ ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"date",value:a.visit_date,onChange:s=>l({...a,visit_date:s.target.value}),className:"compact-input",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"구ë¶"}),e.jsxs("select",{value:a.urgency,onChange:s=>l({...a,urgency:s.target.value}),className:"compact-input",children:[e.jsx("option",{value:"ì¼ë°",children:"ì¼ë°"}),e.jsx("option",{value:"긴ê¸",children:"긴ê¸"}),e.jsx("option",{value:"ë¹ê³µê°",children:"ë¹ê³µê°"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ì¬ë°©ì (ì¼íë¡ êµ¬ë¶)"}),e.jsx("input",{type:"text",value:a.visitors,onChange:s=>l({...a,visitors:s.target.value}),className:"compact-input",placeholder:"í길ë, ê¹ì² ì"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ëíì"}),e.jsx("input",{type:"text",value:a.companion,onChange:s=>l({...a,companion:s.target.value}),className:"compact-input",placeholder:"ëíì"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ì¬ë°© 목ì ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:a.purpose,onChange:s=>l({...a,purpose:s.target.value}),className:"compact-input",placeholder:"ì: ì 기 ì¬ë°©, ë³ë¬¸ì",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ì¥ì"}),e.jsx("input",{type:"text",value:a.location,onChange:s=>l({...a,location:s.target.value}),className:"compact-input",placeholder:"ì: ìí, ë³ì, êµí"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ì¬ë°© ë´ì© ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("textarea",{value:a.content,onChange:s=>l({...a,content:s.target.value}),className:"compact-input",rows:4,placeholder:"ì¬ë°© ë´ì©ì ìì¸í 기ë¡íì¸ì",required:!0})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ë§ì (ì±ê²½ 구ì )"}),e.jsx("input",{type:"text",value:a.scripture,onChange:s=>l({...a,scripture:s.target.value}),className:"compact-input",placeholder:"ì: ìí¸ 23:1-6"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ì°¬ì¡"}),e.jsx("input",{type:"text",value:a.hymn,onChange:s=>l({...a,hymn:s.target.value}),className:"compact-input",placeholder:"ì: ì°¬ì¡ê° 370ì¥"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"기ë ì 목
3(ì¤ë°ê¿ì¼ë¡ 구ë¶)"}),e.jsx("textarea",{value:a.prayer_topics,onChange:s=>l({...a,prayer_topics:s.target.value}),className:"compact-input",rows:3,placeholder:`ê±´ê° íë³µ 4ê°ì¡± íì`})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",checked:a.follow_up_needed,onChange:s=>l({...a,follow_up_needed:s.target.checked}),className:"w-4 h-4"}),e.jsx("span",{className:"text-[12px] font-medium text-gray-700",children:"íìì¡°ì¹ íì"})]}),a.follow_up_needed&&e.jsx("input",{type:"date",value:a.follow_up_date,onChange:s=>l({...a,follow_up_date:s.target.value}),className:"compact-input"})]}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-gray-200",children:[e.jsxs("label",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:s=>r(s.target.checked),className:"w-4 h-4"}),e.jsx("span",{className:"text-[12px] text-gray-600",children:"ì°ì ì ë ¥"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",onClick:j,className:"px-4 py-2 border border-gray-300 rounded hover:bg-gray-50 text-[13px]",children:"ì·¨ì"}),e.jsx("button",{type:"submit",disabled:p,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 text-[13px] font-medium disabled:opacity-50",children:p?"ì¶ê° ì¤...":"ì¶ê°"})]})]})]})]})})}function Pe({visit:d,members:j,onClose:h,onSuccess:p}){var u,i;const[b,g]=m.useState(!1),[r,t]=m.useState({member_id:d.member_id,visit_date:d.visit_date,visit_type:d.visit_type,urgency:d.urgency||"ì¼ë°",visitors:((u=d.visitors)==null?void 0:u.join(", "))||"",companion:d.companion||"",purpose:d.purpose,content:d.content,location:d.location||"",scripture:d.scripture||"",hymn:d.hymn||"",prayer_topics:((i=d.prayer_topics)==null?void 0:i.join(` 5`))||"",follow_up_needed:d.follow_up_needed,follow_up_date:d.follow_up_date||""}),o=j.find(a=>a.id===d.member_id);async function x(a){if(a.preventDefault(),!r.member_id||!r.purpose||!r.content){S.error("íì í목ì ì ë ¥íì¸ì");return}try{g(!0),await q.updateVisit(d.id,{member_id:r.member_id,visit_date:r.visit_date,visit_type:r.visit_type,urgency:r.urgency,visitors:r.visitors.split(",").map(l=>l.trim()).filter(l=>l),companion:r.companion.trim()||void 0,purpose:r.purpose,content:r.content,location:r.location.trim()||void 0,scripture:r.scripture.trim()||void 0,hymn:r.hymn.trim()||void 0,prayer_topics:r.prayer_topics?r.prayer_topics.split(` 6`).map(l=>l.trim()).filter(l=>l):void 0,follow_up_needed:r.follow_up_needed,follow_up_date:r.follow_up_needed?r.follow_up_date:void 0}),S.success("ì¬ë°© 기ë¡ì´ ìì ëììµëë¤"),p()}catch{S.error("ìì ì ì¤í¨íìµëë¤")}finally{g(!1)}}return e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-xl w-full max-h-[90vh] overflow-y-auto",children:[e.jsxs("div",{className:"p-4 border-b border-gray-200 flex items-center justify-between",children:[e.jsxs("h2",{className:"text-[16px] font-bold text-gray-900 flex items-center gap-2",children:[e.jsx(H,{className:"w-4 h-4 text-blue-600"}),"ì¬ë°© ê¸°ë¡ ìì "]}),e.jsx("button",{onClick:h,className:"p-1 hover:bg-gray-100 rounded",children:e.jsx(G,{className:"w-5 h-5 text-gray-500"})})]}),e.jsxs("form",{onSubmit:x,className:"p-4 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"êµì¸"}),e.jsx("input",{type:"text",value:(o==null?void 0:o.name)||d.member_name||"-",disabled:!0,className:"compact-input bg-gray-50"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ì¬ë°© ì í ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs("select",{value:r.visit_type,onChange:a=>t({...r,visit_type:a.target.value}),className:"compact-input",children:[e.jsx("option",{value:"ê°ì ì¬ë°©",children:"ê°ì ì¬ë°©"}),e.jsx("option",{value:"ë³ìì¬ë°©",children:"ë³ìì¬ë°©"}),e.jsx("option",{value:"ì íì¬ë°©",children:"ì íì¬ë°©"}),e.jsx("option",{value:"ìë´",children:"ìë´"}),e.jsx("option",{value:"ì´ì¬ì¬ë°©",children:"ì´ì¬ì¬ë°©"}),e.jsx("option",{value:"ì¶íì¬ë°©",children:"ì¶íì¬ë°©"}),e.jsx("option",{value:"ìë¡ì¬ë°©",children:"ìë¡ì¬ë°©"}),e.jsx("option",{value:"ìíì¬ë°©",children:"ìíì¬ë°©"}),e.jsx("option",{value:"ë±ë¡ì¬ë°©",children:"ë±ë¡ì¬ë°©"}),e.jsx("option",{value:"ì¥ê²°ìì¬ë°©",children:"ì¥ê²°ìì¬ë°©"}),e.jsx("option",{value:"구ììë°°",children:"구ììë°°"}),e.jsx("option",{value:"기í",children:"기í"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ì¬ë°© ë ì§ ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"date",value:r.visit_date,onChange:a=>t({...r,visit_date:a.target.value}),className:"compact-input",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"구ë¶"}),e.jsxs("select",{value:r.urgency,onChange:a=>t({...r,urgency:a.target.value}),className:"compact-input",children:[e.jsx("option",{value:"ì¼ë°",children:"ì¼ë°"}),e.jsx("option",{value:"긴ê¸",children:"긴ê¸"}),e.jsx("option",{value:"ë¹ê³µê°",children:"ë¹ê³µê°"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ì¬ë°©ì (ì¼íë¡ êµ¬ë¶)"}),e.jsx("input",{type:"text",value:r.visitors,onChange:a=>t({...r,visitors:a.target.value}),className:"compact-input",placeholder:"í길ë, ê¹ì² ì"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ëíì"}),e.jsx("input",{type:"text",value:r.companion,onChange:a=>t({...r,companion:a.target.value}),className:"compact-input",placeholder:"ëíì"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ì¬ë°© 목ì ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:r.purpose,onChange:a=>t({...r,purpose:a.target.value}),className:"compact-input",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ì¥ì"}),e.jsx("input",{type:"text",value:r.location,onChange:a=>t({...r,location:a.target.value}),className:"compact-input",placeholder:"ì: ìí, ë³ì, êµí"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:["ì¬ë°© ë´ì© ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("textarea",{value:r.content,onChange:a=>t({...r,content:a.target.value}),className:"compact-input",rows:4,required:!0})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ë§ì (ì±ê²½ 구ì )"}),e.jsx("input",{type:"text",value:r.scripture,onChange:a=>t({...r,scripture:a.target.value}),className:"compact-input",placeholder:"ì: ìí¸ 23:1-6"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"ì°¬ì¡"}),e.jsx("input",{type:"text",value:r.hymn,onChange:a=>t({...r,hymn:a.target.value}),className:"compact-input",placeholder:"ì: ì°¬ì¡ê° 370ì¥"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[12px] font-medium text-gray-700 mb-1",children:"기ë ì 목
6(ì¤ë°ê¿ì¼ë¡ 구ë¶)"}),e.jsx("textarea",{value:r.prayer_topics,onChange:a=>t({...r,prayer_topics:a.target.value}),className:"compact-input",rows:3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",checked:r.follow_up_needed,onChange:a=>t({...r,follow_up_needed:a.target.checked}),className:"w-4 h-4"}),e.jsx("span",{className:"text-[12px] font-medium text-gray-700",children:"íìì¡°ì¹ íì"})]}),r.follow_up_needed&&e.jsx("input",{type:"date",value:r.follow_up_date,onChange:a=>t({...r,follow_up_date:a.target.value}),className:"compact-input"})]}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsx("button",{type:"button",onClick:h,className:"flex-1 px-3 py-2 border border-gray-300 rounded hover:bg-gray-50 text-[13px]",children:"ì·¨ì"}),e.jsx("button",{type:"submit",disabled:b,className:"flex-1 px-3 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 text-[13px] font-medium disabled:opacity-50",children:b?"ìì ì¤...":"ìì "})]})]})]})})}function Ye({memberId:d,member:j,visits:h,onClose:p,onEdit:b,onDelete:g,onPrint:r,onExport:t}){var y,f,v,_;const[o,x]=m.useState(!1),u=(j==null?void 0:j.name)||((y=h[0])==null?void 0:y.member_name)||"(ì´ë¦ ìì)",i=(j==null?void 0:j.position)||((v=(f=h[0])==null?void 0:f.original_data)==null?void 0:v.position)||"",a={ê°ì ì¬ë°©:"bg-blue-500",ë³ìì¬ë°©:"bg-red-500",ì íì¬ë°©:"bg-green-500",ìë´:"bg-blue-500",ì´ì¬ì¬ë°©:"bg-cyan-500",ì¶íì¬ë°©:"bg-blue-500",ìë¡ì¬ë°©:"bg-blue-500",ìíì¬ë°©:"bg-blue-500",ë±ë¡ì¬ë°©:"bg-lime-500",ì¥ê²°ìì¬ë°©:"bg-amber-500",구ììë°°:"bg-orange-500",기í:"bg-gray-500"},l={total:h.length,lastVisit:((_=h[0])==null?void 0:_.visit_date)||"-",visitTypes:h.reduce((s,c)=>(s[c.visit_type]=(s[c.visit_type]||0)+1,s),{}),followUpCount:h.filter(s=>s.follow_up_needed).length};return e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-2xl w-full max-h-[90vh] flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b border-gray-200 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[j!=null&&j.photo_url&&!o?e.jsx("img",{src:j.photo_url,alt:u,className:"w-10 h-10 rounded-full object-cover",onError:()=>x(!0)}):e.jsx("div",{className:`w-10 h-10 rounded-full flex items-center justify-center text-[15px] font-bold shadow-sm ${j?"bg-blue-600 text-white":"bg-amber-100 text-amber-700"}`,children:u[0]||"?"}),e.jsxs("div",{children:[e.jsxs("h2",{className:"text-[16px] font-bold text-gray-900 flex items-center gap-2",children:[e.jsx(Me,{className:"w-4 h-4 text-blue-600"}),u," ì¬ë°© íì¤í 리",!j&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 bg-amber-100 text-amber-700 rounded",children:"ë모ë°"})]}),e.jsx("p",{className:"text-[12px] text-gray-500",children:i})]})]}),e.jsx("button",{onClick:p,className:"p-1 hover:bg-gray-100 rounded",children:e.jsx(G,{className:"w-5 h-5 text-gray-500"})})]}),e.jsx("div",{className:"p-4 bg-gray-50 border-b border-gray-200",children:e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-[20px] font-bold text-blue-600",children:l.total}),e.jsx("div",{className:"text-[11px] text-gray-500",children:"ì´ ì¬ë°©"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-[13px] font-bold text-gray-900",children:l.lastVisit}),e.jsx("div",{className:"text-[11px] text-gray-500",children:"ìµê·¼ ì¬ë°©"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-[20px] font-bold text-blue-600",children:l.visitTypes.ê°ì ì¬ë°©||0}),e.jsx("div",{className:"text-[11px] text-gray-500",children:"ê°ì ì¬ë°©"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-[20px] font-bold text-orange-600",children:l.followUpCount}),e.jsx("div",{className:"text-[11px] text-gray-500",children:"íìì¡°ì¹"})]})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:h.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(te,{className:"w-12 h-12 text-gray-300 mx-auto mb-3"}),e.jsx("p",{className:"text-[13px] text-gray-500",children:"ì¬ë°© 기ë¡ì´ ììµëë¤"})]}):e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute left-4 top-0 bottom-0 w-0.5 bg-gray-200"}),e.jsx("div",{className:"space-y-4",children:h.map(s=>e.jsxs("div",{className:"relative pl-10",children:[e.jsx("div",{className:`absolute left-2.5 w-3 h-3 rounded-full ${a[s.visit_type]||a.기í}
6`,style:{top:"6px"}}),e.jsxs("div",{className:"bg-white border border-gray-200 rounded p-3 hover:shadow-sm transition-shadow",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[13px] font-bold text-gray-900",children:s.visit_date}),e.jsx("span",{className:`text-[11px] px-2 py-0.5 rounded font-medium text-white ${a[s.visit_type]||a.기í}`,children:s.visit_type}),s.urgency&&s.urgency!=="ì¼ë°"&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 bg-red-50 text-red-600 rounded",children:s.urgency}),s.follow_up_needed&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 bg-orange-100 text-orange-700 rounded",children:"íìì¡°ì¹"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>b(s),className:"p-1 hover:bg-gray-100 rounded",title:"ìì ",children:e.jsx(H,{className:"w-3 h-3 text-blue-600"})}),e.jsx("button",{onClick:()=>g(s.id),className:"p-1 hover:bg-gray-100 rounded",title:"ìì ",children:e.jsx(ae,{className:"w-3 h-3 text-red-600"})})]})]}),e.jsxs("div",{className:"space-y-1.5 text-[12px]",children:[s.visitors&&s.visitors.length>0&&e.jsxs("div",{className:"flex items-center gap-1 text-gray-600",children:[e.jsx(se,{className:"w-3 h-3 text-gray-400"}),e.jsxs("span",{children:["ì¬ë°©ì: ",s.visitors.join(", ")]})]}),s.companion&&e.jsxs("div",{className:"text-gray-600",children:[e.jsx("span",{className:"font-medium text-gray-700",children:"ëíì:"})," ",s.companion]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"목ì :"}),e.jsx("span",{className:"text-gray-600 ml-1",children:s.purpose})]}),s.location&&e.jsxs("div",{className:"flex items-center gap-1 text-gray-600",children:[e.jsx(De,{className:"w-3 h-3 text-gray-400"}),e.jsxs("span",{children:["ì¥ì: ",s.location]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"ë´ì©:"}),e.jsx("p",{className:"text-gray-600 mt-0.5 whitespace-pre-wrap",children:s.content})]}),s.scripture&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"ë§ì:"}),e.jsx("span",{className:"text-gray-600 ml-1",children:s.scripture})]}),s.hymn&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"ì°¬ì¡:"}),e.jsx("span",{className:"text-gray-600 ml-1",children:s.hymn})]}),s.prayer_topics&&s.prayer_topics.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"기ë ì 목:"}),e.jsx("ul",{className:"text-gray-600 mt-0.5 ml-4",children:s.prayer_topics.map((c,N)=>e.jsx("li",{className:"list-disc",children:c},N))})]}),s.follow_up_needed&&s.follow_up_date&&e.jsxs("div",{className:"flex items-center gap-1 text-orange-600",children:[e.jsx($e,{className:"w-3 h-3"}),e.jsxs("span",{children:["íìì¡°ì¹ ìì : ",s.follow_up_date]})]})]})]})]},s.id))})]})}),e.jsx("div",{className:"p-4 border-t border-gray-200",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:r,className:"flex-1 flex items-center justify-center gap-1.5 px-4 py-2 border border-gray-300 text-gray-700 rounded hover:bg-gray-50 text-[13px] font-medium",children:[e.jsx(ee,{className:"w-4 h-4"}),"ì¸ì"]}),e.jsxs("button",{onClick:t,className:"flex-1 flex items-center justify-center gap-1.5 px-4 py-2 border border-gray-300 text-gray-700 rounded hover:bg-gray-50 text-[13px] font-medium",children:[e.jsx(B,{className:"w-4 h-4"}),"ìì
"]}),e.jsx("button",{onClick:p,className:"flex-1 px-4 py-2 bg-gray-100 text-gray-700 rounded hover:bg-gray-200 text-[13px] font-medium",children:"ë«ê¸°"})]})})]})})}function Le({member:d,visits:j,onClose:h}){var r;if(!d)return null;const p={ê°ì ì¬ë°©:"#3b82f6",ë³ìì¬ë°©:"#ef4444",ì íì¬ë°©:"#22c55e",ìë´:"#a855f7",기í:"#6b7280"},b={total:j.length,lastVisit:((r=j[0])==null?void 0:r.visit_date)||"-",visitTypes:j.reduce((t,o)=>(t[o.visit_type]=(t[o.visit_type]||0)+1,t),{}),followUpCount:j.filter(t=>t.follow_up_needed).length};function g(){const t=document.getElementById("print-content");
6if(!t)return;const o=window.open("","_blank");if(!o){S.error("íì ì´ ì°¨ë¨ëììµëë¤.");return}o.document.write(`<!DOCTYPE html><html><head><title>${d.name} ì¬ë°© íì¤í 리</title><style> 7 *{margin:0;padding:0;box-sizing:border-box}body{font-family:'Malgun Gothic',sans-serif;padding:20px;font-size:12px} 8 .header{text-align:center;margin-bottom:20px;padding-bottom:15px;border-bottom:2px solid #333}.header h1{font-size:18px;margin-bottom:5px} 9 .stats{display:flex;justify-content:space-around;margin-bottom:20px;padding:10px;background:#f5f5f5} 10 .visit-item{margin-bottom:15px;padding:10px;border:1px solid #ddd;border-radius:4px;page-break-inside:avoid} 11 .visit-type{padding:2px 8px;border-radius:4px;color:white;font-size:10px} 12 .footer{margin-top:20px;text-align:center;font-size:10px;color:#999;border-top:1px solid #ddd;padding-top:10px} 13 @media print{body{padding:0}.no-print{display:none}} 14 </style></head><body>${t.innerHTML}<div class="footer">ìëêµí ChurchOS - ì¶ë ¥ì¼: ${new Date().toLocaleDateString("ko-KR")}</div></body></html>`),o.document.close(),o.focus(),setTimeout(()=>{o.print(),o.close()},250)}return e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-3xl w-full max-h-[90vh] flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b border-gray-200 flex items-center justify-between",children:[e.jsxs("h2",{className:"text-[16px] font-bold text-gray-900 flex items-center gap-2",children:[e.jsx(ee,{className:"w-4 h-4 text-gray-600"}),"ì¸ì 미리보기"]}),e.jsx("button",{onClick:h,className:"p-1 hover:bg-gray-100 rounded",children:e.jsx(G,{className:"w-5 h-5 text-gray-500"})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6 bg-gray-100",children:e.jsxs("div",{id:"print-content",className:"bg-white p-6 shadow-sm max-w-2xl mx-auto",style:{minHeight:"600px"},children:[e.jsxs("div",{className:"header text-center mb-6 pb-4 border-b-2 border-gray-800",children:[e.jsxs("h1",{className:"text-xl font-bold mb-1",children:[d.name," ì¬ë°© íì¤í 리"]}),e.jsxs("p",{className:"text-sm text-gray-600",children:[d.position," | ì´ ",b.total,"í ì¬ë°©"]})]}),e.jsxs("div",{className:"stats grid grid-cols-4 gap-4 mb-6 p-3 bg-gray-50 rounded",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-lg font-bold text-green-600",children:b.total}),e.jsx("div",{className:"text-xs text-gray-500",children:"ì´ ì¬ë°©"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-sm font-bold",children:b.lastVisit}),e.jsx("div",{className:"text-xs text-gray-500",children:"ìµê·¼ ì¬ë°©"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-lg font-bold text-blue-600",children:b.visitTypes.ê°ì ì¬ë°©||0}),e.jsx("div",{className:"text-xs text-gray-500",children:"ê°ì ì¬ë°©"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-lg font-bold text-orange-600",children:b.followUpCount}),e.jsx("div",{className:"text-xs text-gray-500",children:"íìì¡°ì¹"})]})]}),e.jsx("div",{className:"space-y-4",children:j.map(t=>e.jsxs("div",{className:"p-3 border border-gray-200 rounded",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"font-bold",children:t.visit_date}),e.jsx("span",{className:"text-xs px-2 py-0.5 rounded text-white",style:{backgroundColor:p[t.visit_type]||p.기í},children:t.visit_type})]}),e.jsxs("div",{className:"text-xs space-y-1 text-gray-700",children:[t.visitors&&t.visitors.length>0&&e.jsxs("p",{children:[e.jsx("strong",{children:"ì¬ë°©ì:"})," ",t.visitors.join(", ")]}),t.companion&&e.jsxs("p",{children:[e.jsx("strong",{children:"ëíì:"})," ",t.companion]}),e.jsxs("p",{children:[e.jsx("strong",{children:"목ì :"})," ",t.purpose]}),t.location&&e.jsxs("p",{children:[e.jsx("strong",{children:"ì¥ì:"})," ",t.location]}),e.jsxs("p",{children:[e.jsx("strong",{children:"ë´ì©:"})," ",t.content]}
14),t.scripture&&e.jsxs("p",{children:[e.jsx("strong",{children:"ë§ì:"})," ",t.scripture]}),t.hymn&&e.jsxs("p",{children:[e.jsx("strong",{children:"ì°¬ì¡:"})," ",t.hymn]}),t.prayer_topics&&t.prayer_topics.length>0&&e.jsxs("p",{children:[e.jsx("strong",{children:"기ëì 목:"})," ",t.prayer_topics.join(", ")]}),t.follow_up_needed&&e.jsxs("p",{className:"text-orange-600",children:[e.jsx("strong",{children:"íìì¡°ì¹ ìì :"})," ",t.follow_up_date||"미ì "]})]})]},t.id))})]})}),e.jsx("div",{className:"p-4 border-t border-gray-200",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:h,className:"flex-1 px-4 py-2 border border-gray-300 text-gray-700 rounded hover:bg-gray-50 text-[13px] font-medium",children:"ì·¨ì"}),e.jsxs("button",{onClick:g,className:"flex-1 flex items-center justify-center gap-1.5 px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 text-[13px] font-medium",children:[e.jsx(ee,{className:"w-4 h-4"}),"ì¸ìí기"]})]})})]})})}function Oe({visits:d,members:j,exportToExcel:h}){const[p,b]=m.useState("monthly");return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex gap-1 bg-gray-100 p-1 rounded-lg overflow-x-auto",children:[["monthly","ìë³ ì¬ë°©íí©"],["visitor","ì¬ë°©ìë³ íµê³"],["type","ì¬ë°©êµ¬ë¶ë³ íµê³"],["individual","ê°ì¸ë³ ì°ê°íµê³"]].map(([g,r])=>e.jsx("button",{onClick:()=>b(g),className:`px-4 py-2 rounded-md text-[13px] font-medium transition-all whitespace-nowrap ${p===g?"bg-white text-blue-600 shadow-sm":"text-gray-500 hover:text-gray-700"}`,children:r},g))}),p==="monthly"&&e.jsx(Ie,{visits:d,members:j}),p==="visitor"&&e.jsx(qe,{visits:d}),p==="type"&&e.jsx(Ae,{visits:d}),p==="individual"&&e.jsx(Re,{visits:d,members:j,exportToExcel:h})]})}function Ie({visits:d,members:j}){const h=new Date,[p,b]=m.useState(h.getFullYear()),[g,r]=m.useState(h.getMonth()),[t,o]=m.useState(null),x=`${p}-${String(g+1).padStart(2,"0")}`,u=new Date(p,g,1).getDay(),i=new Date(p,g+1,0).getDate(),a=m.useMemo(()=>{const c={};return d.forEach(N=>{if(N.visit_date.startsWith(x)){const w=parseInt(N.visit_date.split("-")[2]);c[w]||(c[w]=[]),c[w].push(N)}}),c},[d,x]),l=Object.values(a).reduce((c,N)=>c+N.length,0),y=Object.keys(a).length,f=[];for(let c=0;c<u;c++)f.push(null);for(let c=1;c<=i;c++)f.push(c);for(;f.length%7!==0;)f.push(null);function v(){g===0?(b(p-1),r(11)):r(g-1),o(null)}function _(){g===11?(b(p+1),r(0)):r(g+1),o(null)}const s=t?a[t]||[]:[];return e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("button",{onClick:v,className:"p-2 hover:bg-gray-100 rounded",children:e.jsx(ge,{className:"w-5 h-5 text-gray-600"})}),e.jsxs("div",{className:"text-center",children:[e.jsxs("h3",{className:"text-[16px] font-bold text-gray-900",children:[p,"ë
",g+1,"ì"]}),e.jsxs("p",{className:"text-[12px] text-gray-500",children:["ì¬ë°© ",l,"ê±´ / ",y,"ì¼"]})]}),e.jsx("button",{onClick:_,className:"p-2 hover:bg-gray-100 rounded",children:e.jsx(re,{className:"w-5 h-5 text-gray-600"})})]}),e.jsx("div",{className:"grid grid-cols-7 gap-1 mb-1",children:["ì¼","ì","í","ì","목","ê¸","í "].map((c,N)=>e.jsx("div",{className:`text-center text-[11px] font-bold py-1 ${N===0?"text-red-500":N===6?"text-blue-500":"text-gray-500"}`,children:c},c))}),e.jsx("div",{className:"grid grid-cols-7 gap-1",children:f.map((c,N)=>{var Y;if(c===null)return e.jsx("div",{className:"h-16"},`e${N}`);const w=((Y=a[c])==null?void 0:Y.length)||0,D=p===h.getFullYear()&&g===h.getMonth()&&c===h.getDate(),T=t===c,$=N%7;return e.jsxs("div",{onClick:()=>o(c===t?null:c),className:`h-16 p-1 rounded cursor-pointer transition-all border ${T?"border-blue-600 bg-blue-50 shadow-sm":D?"border-blue-300 bg-blue-50":w>0?"border-gray-200 bg-gray-50 hover:bg-green-50":"border-transparent hover:bg-gray-50"}`,children:[e.jsx("div",{className:`text-[12px] font-medium ${$===0?"text-red-500":$===6?"text-blue-500":"text-gray-700"}`,children:c}),w>0&&e.jsx("div",{className:"mt-1",children:e.jsxs("div",{className:`text-[10px] font-bold text-center rounded py-0.5 ${w>=3?"bg-blue-600 text-white":w>=2?"bg-green-200 text-green-800":"bg-green-100 text-green-700"}`,children:[w,"ê±´"]})})]},c)})}),t&&e.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-200",children:[e.jsxs("h4",{className:"text-[13px] font-bold text-gray-900 mb-3",children:[g+1,"ì ",t,"ì¼ ì¬ë°© (",s.length,"ê±´)"]}),s.length===0?e.jsx("p",{className:"text-[12px] text-gray-500 text-center py-4",children:"ì¬ë°© ê¸°ë¡ ìì"}):e.jsx("div",{className:"space-y-2",children:s.map(c=>{const N=j.find(w=>w.id===c.member_id);return e.jsxs("div",{className:"p-3 bg-gray-50 rounded border border-gray-200 text-[12px]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"font-bold text-gray-900",children:N==null?void 0:N.name}),e.jsx("span",{className:"text-gray-500",children:N==null?void 0:N.position}),e.jsx("span",{className:"text-[10px] px-2 py-0.5 bg-blue-100 text-blue-700 rounded",children:c.visit_type}),c.urgency&&c.urgency!=="ì¼ë°"&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 bg-red-50 text-red-600 rounded",children:c.urgency})]}),c.visitors&&c.visitors.length>0&&e.jsxs("div",{className:"text-gray-600",children:["ì¬ë°©ì: ",c.visitors.join(", ")
14]}),e.jsx("div",{className:"text-gray-600",children:c.purpose}),c.location&&e.jsxs("div",{className:"text-gray-500",children:["ì¥ì: ",c.location]})]},c.id)})})]})]})}function qe({visits:d}){const[j,h]=m.useState("month"),p=new Date,b=m.useMemo(()=>d.filter(t=>{const o=new Date(t.visit_date);if(j==="month")return o.getMonth()===p.getMonth()&&o.getFullYear()===p.getFullYear();if(j==="quarter"){const x=Math.floor(p.getMonth()/3);return Math.floor(o.getMonth()/3)===x&&o.getFullYear()===p.getFullYear()}return o.getFullYear()===p.getFullYear()}),[d,j]),g=m.useMemo(()=>{const t={};return b.forEach(o=>{(o.visitors||[]).forEach(x=>{t[x]||(t[x]={total:0,byType:{}}),t[x].total++,t[x].byType[o.visit_type]=(t[x].byType[o.visit_type]||0)+1})}),Object.entries(t).sort((o,x)=>x[1].total-o[1].total)},[b]),r=["ê°ì ì¬ë°©","ë³ìì¬ë°©","ì íì¬ë°©","ìë´","기í"];return e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-[14px] font-bold text-gray-900",children:"ì¬ë°©ìë³ íµê³"}),e.jsx("div",{className:"flex gap-1",children:[["month","ìê°"],["quarter","ë¶ê¸°"],["year","ì°ê°"]].map(([t,o])=>e.jsx("button",{onClick:()=>h(t),className:`px-3 py-1 rounded text-[12px] ${j===t?"bg-blue-600 text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:o},t))})]}),g.length===0?e.jsx("p",{className:"text-[13px] text-gray-500 text-center py-8",children:"í´ë¹ ê¸°ê° ì¬ë°© 기ë¡ì´ ììµëë¤"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-[12px]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-gray-50",children:[e.jsx("th",{className:"text-left p-2 font-bold text-gray-700",children:"ì¬ë°©ì"}),r.map(t=>e.jsx("th",{className:"text-center p-2 font-bold text-gray-700",children:t},t)),e.jsx("th",{className:"text-center p-2 font-bold text-gray-900",children:"í©ê³"})]})}),e.jsx("tbody",{children:g.map(([t,o])=>e.jsxs("tr",{className:"border-t border-gray-100 hover:bg-gray-50",children:[e.jsx("td",{className:"p-2 font-medium text-gray-900",children:t}),r.map(x=>e.jsx("td",{className:"text-center p-2 text-gray-600",children:o.byType[x]||"-"},x)),e.jsx("td",{className:"text-center p-2 font-bold text-blue-600",children:o.total})]},t))}),e.jsx("tfoot",{children:e.jsxs("tr",{className:"border-t-2 border-gray-300 bg-gray-50",children:[e.jsx("td",{className:"p-2 font-bold text-gray-900",children:"í©ê³"}),r.map(t=>{const o=g.reduce((x,[,u])=>x+(u.byType[t]||0),0);return e.jsx("td",{className:"text-center p-2 font-bold text-gray-700",children:o||"-"},t)}),e.jsx("td",{className:"text-center p-2 font-bold text-blue-600",children:b.length})]})})]})})]})}function Ae({visits:d}){const[j,h]=m.useState("month"),p=new Date,b=m.useMemo(()=>d.filter(x=>{const u=new Date(x.visit_date);if(j==="month")return u.getMonth()===p.getMonth()&&u.getFullYear()===p.getFullYear();if(j==="quarter"){const i=Math.floor(p.getMonth()/3);return Math.floor(u.getMonth()/3)===i&&u.getFullYear()===p.getFullYear()}return u.getFullYear()===p.getFullYear()}),[d,j]),g=m.useMemo(()=>{const x={};return b.forEach(u=>{x[u.visit_type]=(x[u.visit_type]||0)+1}),Object.entries(x).sort((u,i)=>i[1]-u[1])},[b]),r=g.length>0?Math.max(...g.map(([,x])=>x)):1,t={ê°ì ì¬ë°©:"bg-blue-500",ë³ìì¬ë°©:"bg-red-500",ì íì¬ë°©:"bg-green-500",ìë´:"bg-blue-500",기í:"bg-gray-500"},o=m.useMemo(()=>{const x={ì¼ë°:0,긴ê¸:0,ë¹ê³µê°:0};return b.forEach(u=>{const i=u.urgency||"ì¼ë°";x[i]=(x[i]||0)+1}),x},[b]);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-[14px] font-bold text-gray-900",children:"ì¬ë°©ì íë³ íµê³"}),e.jsx("div",{className:"flex gap-1",children:[["month","ìê°"],["quarter","ë¶ê¸°"],["year","ì°ê°"]].map(([x,u])=>e.jsx("button",{onClick:()=>h(x),className:`px-3 py-1 rounded text-[12px] ${j===x?"bg-blue-600 text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:u},x))})]}),g.length===0?e.jsx("p",{className:"text-[13px] text-gray-500 text-center py-8",children:"í´ë¹ ê¸°ê° ì¬ë°© 기ë¡ì´ ììµëë¤"}):e.jsxs("div",{className:"space-y-3",children:[g.map(([x,u])=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-[12px] font-medium text-gray-700",children:x}),e.jsxs("span",{className:"text-[12px] font-bold text-gray-900",children:[u,"ê±´"]})]}),e.jsx("div",{className:"w-full bg-gray-100 rounded-full h-6",children:e.jsx("div",{className:`h-6 rounded-full ${t[x]||t.기í} flex items-center justify-end pr-2 transition-all duration-500`,style:{width:`${Math.max(u/r*100,8)}%`},children:e.jsxs("span",{className:"text-[10px] text-white font-bold",children:[(u/b.length*100).toFixed(0),"%"]})})})]},x)),e.jsx("div",{className:"pt-3 border-t border-gray-200 text-center",children:e.jsxs("span",{className:"text-[13px] font-bold text-gray-900",children:["ì´ ",b.length,"ê±´"]})})]})]}),e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-4",children:[e.jsx("h3",{className:"text-[14px] font-bold text-gray-900 mb-4",children:"구ë¶ë³ íµê³"}),e.jsx("div",{className:"grid grid-cols-3 gap-4",children:Object.entries(o).map(([x,u])=>{const i={ì¼ë°:"text-blue-600 bg-blue-50",긴ê¸:"text-red-600 bg-red-50",ë¹ê³µê°:"text-gray-600 bg-gray-100"};return e.jsxs("div",{className:`text-center p-4 rounded-lg ${i[x]||"bg-gray-50"}`,children:[e.jsx("div",{className:"text-[24px] font-bold",children:u}
14),e.jsx("div",{className:"text-[12px] font-medium mt-1",children:x})]},x)})})]})]})}function Re({visits:d,members:j,exportToExcel:h}){const[p,b]=m.useState(new Date().getFullYear()),g=m.useMemo(()=>d.filter(i=>i.visit_date.startsWith(String(p))),[d,p]),r=m.useMemo(()=>{const i={};return g.forEach(a=>{const l=j.find(f=>f.id===a.member_id);if(!l)return;i[a.member_id]||(i[a.member_id]={name:l.name,position:l.position||"",months:Array(12).fill(0),total:0});const y=parseInt(a.visit_date.split("-")[1])-1;i[a.member_id].months[y]++,i[a.member_id].total++}),Object.values(i).sort((a,l)=>l.total-a.total)},[g,j]),t=m.useMemo(()=>{const i=Array(12).fill(0);return r.forEach(a=>a.months.forEach((l,y)=>{i[y]+=l})),i},[r]),o=t.reduce((i,a)=>i+a,0),x=m.useMemo(()=>{const i=new Set(d.map(a=>parseInt(a.visit_date.split("-")[0])));return i.add(new Date().getFullYear()),Array.from(i).sort((a,l)=>l-a)},[d]);function u(){if(r.length===0){S.error("ë´ë³´ë¼ ë°ì´í°ê° ììµëë¤");return}const a=["êµì¸ëª ","ì§ë¶",...["1ì","2ì","3ì","4ì","5ì","6ì","7ì","8ì","9ì","10ì","11ì","12ì"],"í©ê³"],l=r.map(s=>[s.name,s.position,...s.months.map(c=>c||""),s.total]);l.push(["í©ê³","",...t.map(s=>s||""),o]);const y=[a.join(","),...l.map(s=>s.map(c=>`"${c}"`).join(","))].join(` 15`),f=new Blob(["\uFEFF"+y],{type:"text/csv;charset=utf-8;"}),v=URL.createObjectURL(f),_=document.createElement("a");_.href=v,_.download=`ê°ì¸ë³ì°ê°ì¬ë°©_${p}.csv`,_.click(),URL.revokeObjectURL(v),S.success("ìì íì¼ì´ ë¤ì´ë¡ëëììµëë¤")}return e.jsxs("div",{className:"bg-white border border-gray-200 rounded shadow-sm p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-[14px] font-bold text-gray-900",children:"ê°ì¸ë³ ì°ê° ì¬ë°©íµê³"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("select",{value:p,onChange:i=>b(Number(i.target.value)),className:"compact-input w-auto",children:x.map(i=>e.jsxs("option",{value:i,children:[i,"ë "]},i))}),e.jsxs("button",{onClick:u,className:"flex items-center gap-1.5 px-3 py-1.5 border border-gray-300 text-gray-700 rounded hover:bg-gray-50 text-[12px] font-medium",children:[e.jsx(B,{className:"w-3.5 h-3.5"}),"ìì "]})]})]}),r.length===0?e.jsxs("p",{className:"text-[13px] text-gray-500 text-center py-8",children:[p,"ë ì¬ë°© 기ë¡ì´ ììµëë¤"]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-[11px]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-gray-50",children:[e.jsx("th",{className:"text-left p-2 font-bold text-gray-700 sticky left-0 bg-gray-50",children:"êµì¸ëª "}),e.jsx("th",{className:"text-left p-2 font-bold text-gray-700",children:"ì§ë¶"}),Array.from({length:12},(i,a)=>e.jsxs("th",{className:"text-center p-2 font-bold text-gray-700 min-w-[36px]",children:[a+1,"ì"]},a)),e.jsx("th",{className:"text-center p-2 font-bold text-gray-900 bg-green-50",children:"í©ê³"})]})}),e.jsx("tbody",{children:r.map(i=>e.jsxs("tr",{className:"border-t border-gray-100 hover:bg-gray-50",children:[e.jsx("td",{className:"p-2 font-medium text-gray-900 sticky left-0 bg-white",children:i.name}),e.jsx("td",{className:"p-2 text-gray-500",children:i.position}),i.months.map((a,l)=>e.jsx("td",{className:`text-center p-2 ${a>0?"text-blue-600 font-bold":"text-gray-300"}`,children:a||"-"},l)),e.jsx("td",{className:"text-center p-2 font-bold text-blue-600 bg-green-50",children:i.total})]},i.name))}),e.jsx("tfoot",{children:e.jsxs("tr",{className:"border-t-2 border-gray-300 bg-gray-50",children:[e.jsx("td",{className:"p-2 font-bold text-gray-900 sticky left-0 bg-gray-50",children:"í©ê³"}),e.jsx("td",{className:"p-2"}),t.map((i,a)=>e.jsx("td",{className:`text-center p-2 font-bold ${i>0?"text-gray-900":"text-gray-300"}`,children:i||"-"},a)),e.jsx("td",{className:"text-center p-2 font-bold text-blue-600 bg-green-50",children:o})]})})]})}),r.length>0&&e.jsxs("div",{className:"mt-3 text-[11px] text-gray-500 text-right",children:["ì´ ",r.length,"ëª , ",o,"ê±´ì ì¬ë°©"]})]})}export{Ze as VisitManagementPage};
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.