1"use strict";(globalThis.webpackChunkreact_ts=globalThis.webpackChunkreact_ts||[]).push([[4971],{80189(e,s,t){t.r(s);var a=t(5544),l=t(9950),i=t(10300),n=t(78130),r=t(68108),c=t(90983),d=t(77737),o=t(27255),m=t(7838),x=t(13147),h=t(81946),g=t(2263),u=t(97162),p=t(96479),j=t(25692),v=t(16255),f=t(42461),N=t(60348),b=t(83574),y=t(81095),w=t(93245),C=t(56473),S=t(60158),A=t(44813),R=t(2847),k=t(2700),P=t(1478),T=t(44414);const $=()=>{const e=(0,i.wA)(),s=(0,i.d4)(e=>e.adminProfessionalScoring),$=s.performanceMetrics,M=s.performanceMetricsLoading,F=s.performanceMetricsError,I=(0,l.useState)(""),D=(0,a.A)(I,2),E=D[0],z=D[1],V=(0,l.useState)(""),B=(0,a.A)(V,2),W=B[0],_=B[1],Z=(0,l.useState)(null),q=(0,a.A)(Z,2),J=(q[0],q[1]),K=(0,l.useState)(1),L=(0,a.A)(K,2),H=L[0],O=L[1],Y=(0,l.useState)(10),G=(0,a.A)(Y,1)[0],Q=(0,l.useState)(6),U=(0,a.A)(Q,2),X=U[0],ee=U[1],se=(0,l.useRef)(null);(0,l.useEffect)(()=>(se.current&&clearTimeout(se.current),se.current=setTimeout(()=>{_(E)},500),()=>{se.current&&clearTimeout(se.current)}),[E]),(0,l.useEffect)(()=>{e((0,P.JA)({page:H,limit:G,search:W||void 0,months:X}))},[e,H,G,W,X]);const te=(null===$||void 0===$?void 0:$.trendData)||[],ae=(null===$||void 0===$?void 0:$.professionals)||[],le=(null===$||void 0===$?void 0:$.totalCount)||0,ie=(null===$||void 0===$?void 0:$.totalPages)||1,ne=(null===$||void 0===$||$.hasNextPage,(H-1)*G),re=Math.min(ne+G,le);(0,l.useEffect)(()=>{O(1)},[W]);if(M)return(0,T.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,T.jsxs)("div",{className:"text-center",children:[(0,T.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),(0,T.jsx)("p",{className:"mt-4 text-gray-600",children:"Loading performance metrics..."})]})});if(F)return(0,T.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,T.jsxs)("div",{className:"text-center",children:[(0,T.jsx)("p",{className:"text-red-600 mb-4",children:F}),(0,T.jsx)("button",{onClick:()=>e((0,P.JA)({page:H,limit:G,search:W||void 0,months:X})),className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700",children:"Retry"})]})});const ce=e=>{let s=e.professional;return(0,T.jsxs)(v.Zp,{className:"p-6 hover:shadow-md transition-shadow",style:{textAlign:"left"},children:[(0,T.jsxs)("div",{className:"flex justify-between items-start",children:[(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"flex items-center gap-2",children:[(0,T.jsx)("h3",{className:"font-semibold text-lg",children:s.name}),(0,T.jsx)(N.E,{variant:void 0,className:"excellent"===s.status?"bg-green-100 text-green-700":"good"===s.status?"bg-blue-100 text-blue-700":"bg-yellow-100 text-yellow-700",children:s.status.charAt(0).toUpperCase()+s.status.slice(1)})]}),(0,T.jsx)("p",{className:"text-gray-600",children:s.profession})]}),(0,T.jsx)(f.$,{variant:"ghost",size:"sm",onClick:()=>J(s),children:(0,T.jsx)(m.A,{className:"h-4 w-4"})})]}),(0,T.jsxs)("div",{className:"mt-6 grid grid-cols-2 gap-4",children:[(0,T.jsxs)("div",{className:"space-y-4",children:[(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[(0,T.jsx)(g.A,{className:"h-4 w-4"}),"Rating"]}),(0,T.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,T.jsx)("span",{className:"text-2xl font-semibold",children:s.metrics.rating}),(0,T.jsx)(N.E,{variant:void 0,className:"bg-green-100 text-green-700",children:s.trends.rating})]})]}),(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[(0,T.jsx)(d.A,{className:"h-4 w-4"}),"Response Time"]}),(0,T.jsx)("div",{className:"mt-1",children:(0,T.jsx)("span",{className:"text-2xl font-semibold",children:s.metrics.responseTime})})]})]}),(0,T.jsxs)("div",{className:"space-y-4",children:[(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[(0,T.jsx)(u.A,{className:"h-4 w-4"}),"Satisfaction"]}),(0,T.jsx)("div",{className:"mt-1",children:(0,T.jsxs)("span",{className:"text-2xl font-semibold",children:[s.metrics.satisfactionScore,"%"]})})]}),(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[(0,T.jsx)(h.A,{className:"h-4 w-4"}),"Completion Rate"]}),(0,T.jsx)("div",{className:"mt-1",children:(0,T.jsxs)("span",{className:"text-2xl font-semibold",children:[s.metrics.completionRate,"%"]})})]})]})]}),(0,T.jsxs)("div",{className:"mt-6",children:[(0,T.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-500 mb-2",children:[(0,T.jsx)(n.A,{className:"h-4 w-4"}),"Achievements"]}),(0,T.jsx)("div",{className:"flex flex-wrap gap-2",children:s.badges.map((e,s)=>(0,T.jsx)(N.E,{variant:"outline",children:e},s))})]}),(0,T.jsxs)("div",{className:"mt-6 pt-6 border-t grid grid-cols-3 gap-4",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{className:"text-sm text-gray-500",children:"Total Jobs"}),(0,T.jsxs)("div",{className:"font-semibold mt-1",children:[s.metrics.totalJobs,(0,T.jsx)("span",{className:"text-green-600 text-sm ml-2",children:s.trends.jobs})]})]}),(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{className:"text-sm text-gray-500",children:"Emergency Jobs"}),(0,T.jsx)("div",{className:"font-semibold mt-1",children:s.metrics.emergencyJobs})]}),(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{className:"text-sm text-gray-500",children:"Revenue"}),(0,T.jsxs)("div",{className:"font-semibold mt-1",children:[s.metrics.revenueGenerated,(0,T.jsx)("span",{className:"text-green-600 text-sm ml-2",children:s.trends.revenue})]})]})]})]})};return(0,T.jsxs)("div",{className:"min-h-screen bg-gray-50 flex flex-col",style:{textAlign:"left"},children:[(0,T.jsx)(k.A,{}),(0,T.jsx)("main",{className:"flex-1 lg:pl-64 pt-16",children:(0,T.jsx)("div",{className:"p-6",children:(0,T.jsxs)("div",{className:"max-w-7xl mx-auto
1space-y-6",children:[(0,T.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:"Performance Metrics"}),(0,T.jsx)("p",{className:"text-gray-600 mt-1",children:"Monitor and analyze professional performance"})]}),(0,T.jsxs)(f.$,{variant:"outline",className:"flex items-center gap-2",onClick:async()=>{if(!ae||0===ae.length)return void alert("No performance data available to export");const e=(await Promise.all([t.e(7514),t.e(359),t.e(4400),t.e(6770),t.e(1370),t.e(2255),t.e(6310),t.e(5269),t.e(2384),t.e(8691),t.e(5043),t.e(8732),t.e(5599),t.e(2678),t.e(1811),t.e(7098)]).then(t.bind(t,74962))).jsPDF,s=(await Promise.all([t.e(7514),t.e(359),t.e(4400),t.e(6770),t.e(1370),t.e(2255),t.e(6310),t.e(5269),t.e(2384),t.e(8691),t.e(5043),t.e(8732),t.e(5599),t.e(2678),t.e(1811),t.e(7098)]).then(t.bind(t,74620))).default,a=new e,l=a.internal.pageSize.width;a.setFontSize(20),a.setTextColor(99,102,241),a.text("Performance Metrics Report",l/2,20,{align:"center"}),a.setFontSize(10),a.setTextColor(100,100,100),a.text(`Generated: ${(new Date).toLocaleString()}`,l/2,28,{align:"center"}),a.text(`Total Professionals: ${le}`,l/2,34,{align:"center"}
1),a.text(`Reporting Period: Last ${X} months`,l/2,40,{align:"center"});let i=50;a.setFontSize(12),a.setTextColor(0,0,0),a.text("Overall Performance Summary",14,i),i+=5;const n=[["Metric","Value"],["Average Rating",`${(null===$||void 0===$?void 0:$.averageRating)||0} / 5`],["Response Rate",`${(null===$||void 0===$?void 0:$.responseRate)||0}%`],["Completion Rate",`${(null===$||void 0===$?void 0:$.completionRate)||0}%`],["Top Performers",`${(null===$||void 0===$?void 0:$.topPerformers)||0}`]];s(a,{startY:i,head:[n[0]],body:n.slice(1),theme:"striped",headStyles:{fillColor:[99,102,241]},margin:{left:14,right:14}}),i=a.lastAutoTable.finalY+15,a.setFontSize(12),a.text("Professional Performance Details",14,i),i+=5;const r=[["Name","Profession","Rating","Satisfaction","Completion","Total Jobs","Status"],...ae.map(e=>[e.name.substring(0,20),e.profession.substring(0,15),`${e.metrics.rating}/5`,`${e.metrics.satisfactionScore}%`,`${e.metrics.completionRate}%`,e.metrics.totalJobs.toString(),e.status.charAt(0).toUpperCase()+e.status.slice(1)])];s(a,{startY:i,head:[r[0]],body:r.slice(1),theme:"striped",headStyles:{fillColor:[99,102,241]},margin:{left:14,right:14},styles:{fontSize:7}});const c=a.internal.getNumberOfPages();for(let t=1;t<=c;t++)a.setPage(t),a.setFontSize(8),a.setTextColor(150),a.text(`Page ${t} of ${c}`,l/2,a.internal.pageSize.height-10,{align:"center"});a.save(`kokobeo_performance_metrics_${(new Date).toISOString().split("T")[0]}.pdf`)},disabled:!ae||0===ae.length,children:[(0,T.jsx)(o.A,{className:"h-4 w-4"}),"Export Report"]})]}),(0,T.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[(0,T.jsx)(v.Zp,{className:"p-6",children:(0,T.jsxs)("div",{className:"flex justify-between items-start",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)("p",{className:"text-sm text-gray-500",children:"Avg Rating"}),(0,T.jsx)("p",{className:"text-2xl font-semibold mt-1",children:(null===$||void 0===$?void 0:$.averageRating)||0})]}),(0,T.jsx)("div",{className:"p-2 bg-yellow-100 rounded-lg",children:(0,T.jsx)(g.A,{className:"h-5 w-5 text-yellow-600"})})]})}),(0,T.jsx)(v.Zp,{className:"p-6",children:(0,T.jsxs)("div",{className:"flex justify-between items-start",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)("p",{className:"text-sm text-gray-500",children:"Response Rate"}),(0,T.jsxs)("p",{className:"text-2xl font-semibold mt-1",children:[(null===$||void 0===$?void 0:$.responseRate)||0,"%"]})]}),(0,T.jsx)("div",{className:"p-2 bg-green-100 rounded-lg",children:(0,T.jsx)(j.A,{className:"h-5 w-5 text-green-600"})})]})}),(0,T.jsx)(v.Zp,{className:"p-6",children:(0,T.jsxs)("div",{className:"flex justify-between items-start",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)("p",{className:"text-sm text-gray-500",children:"Completion Rate"}),(0,T.jsxs)("p",{className:"text-2xl font-semibold mt-1",children:[(null===$||void 0===$?void 0:$.completionRate)||0,"%"]})]}),(0,T.jsx)("div",{className:"p-2 bg-blue-100 rounded-lg",children:(0,T.jsx)(h.A,{className:"h-5 w-5 text-blue-600"})})]})}),(0,T.jsx)(v.Zp,{className:"p-6",children:(0,T.jsxs)("div",{className:"flex justify-between items-start",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)("p",{className:"text-sm text-gray-500",children:"Top Performers"}),(0,T.jsx)("p",{className:"text-2xl font-semibold mt-1",children:(null===$||void 0===$?void 0:$.topPerformers)||0})]}),(0,T.jsx)("div",{className:"p-2 bg-purple-100 rounded-lg",children:(0,T.jsx)(n.A,{className:"h-5 w-5 text-purple-600"})})]})})]}),(0,T.jsxs)(v.Zp,{className:"p-6",children:[(0,T.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,T.jsx)("h2",{className:"text-lg font-semibold",children:"Performance Trends"}),(0,T.jsxs)("select",{value:X,onChange:e=>ee(Number(e.target.value)),className:"border rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[(0,T.jsx)("option",{value:6,children:"Last 6 months"}),(0,T.jsx)("option",{value:12,children:"Last 12 months"})]})]}),(0,T.jsx)("div",{className:"h-80",children:(0,T.jsx)(y.u,{width:"100%",height:"100%",children:(0,T.jsxs)(R.b,{data:te,children:[(0,T.jsx)(w.d,{strokeDasharray:"3 3"}),(0,T.jsx)(S.W,{dataKey:"month"}),(0,T.jsx)(A.h,{}),(0,T.jsx)(b.m,{}),(0,T.jsx)(C.N,{type:"monotone",dataKey:"rating",stroke:"#4f46e5",strokeWidth:2,name:"Rating"}),(0,T.jsx)(C.N,{type:"monotone",dataKey:"completion",stroke:"#16a34a",strokeWidth:2,name:"Completion Rate"}),(0,T.jsx)(C.N,{type:"monotone",dataKey:"response",stroke:"#db2777",strokeWidth:2,name:"Response Rate"})]})})})]}),(0,T.jsx)(v.Zp,{className:"p-4",children:(0,T.jsxs)("div",{className:"flex items-center gap-4",children:[(0,T.jsxs)("div",{className:"relative flex-1",children:[(0,T.jsx)(x.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,T.jsx)("input",{type:"text",placeholder:"Search professionals by name or profession...",value:E,onChange:e=>{z(e.target.value)},className:"w-full pl-10 pr-10 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"}),E&&(0,T.jsx)("button",{onClick:()=>{z("")},className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600","aria-label":"Clear search",children:(0,T.jsx)(p.A,{className:"h-5 w-5"})})]}),W&&W!==E&&(0,T.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[(0,T.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"}),(0,T.jsx)("span",{children:"Searching..."})]})]})}),(0,T.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:ae.length>0?ae.map(e=>(0,T.jsx)(ce,{professional:e},e.id)):(0,T.jsx)("div",{className:"col-span-2 text-center py-12",children:(0,T.jsx)("p",{className:"text-gray-500",children:"No professionals found matching your criteria"})})}),ie>1&&(0,T.jsx)(v.Zp,{className:"p-4",children:(0,T.jsxs)("div",{className:"flex items-center justify-between",children:[(0,T.jsxs)("div",{className:"text-sm text-gray-600",children:["Showing ",ne+1," to ",re," of ",le," professionals"]}),(0,T.jsxs)("div",{className:"flex items-center gap-2",children:[(0,T.jsxs)(f.$,{variant:"outline",size:"sm",onClick:()=>O(e=>Math.max(e-1,1)),disabled:1===H,className:"flex items-center gap-1",children:[(0,T.jsx)(r.A,{className:"h-4 w-4"}),"Previous"]}),(0,T.jsx)("div",{className:"flex items-center gap-1",children:Array.from({length:ie},(e,s)=>s+1).map(e=>1===e||e===ie||e>=H-1&&e<=H+1?(0,T.jsx)("button",{onClick:()=>O(e),className:"px-3 py-1 rounded "+(H===e?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:e},e):e===H-2||e===H+2?(0,T.jsx)("span",{className:"px-2",children:"..."},e):null)}),(0,T.jsxs)(f.$,{variant:"outline",size:"sm",onClick:()=>O(e=>Math.min(e+1,ie)),disabled:H===ie,className:"flex items-center gap-1",children:["Next",(0,T.jsx)(c.A,{className:"h-4 w-4"})]})]})]})})]})})})]})};t.d(s,["default",0,$])},89919(e,s,t){t.r(s);var a=t(5544),l=t(9950),i=t(54060),n=t(10300),r=t(52828),c=t(45833),d=t(59469),o=t(15924),m=t(78130),x=t(85354),h=t(77737),g=t(7838),u=t(67637),p=t(47770),j=t(6890),v=t(29975),f=t(55120),N=t(16255),b=t(42461),y=t(60348),w=t(2700),C=t(12810),S=t(44414);const A=()=>{const e=(0,n.wA)(),s=(0,n.d4)(e=>e.professionalMonitoring),t=s.allMonitoringData,A=s.monitoringPagination,R=s.reports,k=s.reportsPagination,P=s.loading,T=(0,l.useState)("monitoring"),$=(0,a.A)(T,2),M=$[0],F=$[1],I=(0,l.useState)("all"),D=(0,a.A)(I,2),E=D[0],z=D[1],V=(0,l.useState)(void 0),B=(0,a.A)(V,2),W=B[0],_=B[1],Z=(0,l.useState)(""),q=(0,a.A)(Z,2),J=(q[0],q[1],(0,l.useState)(null)),K=(0,a.A)(J,2),L=K[0],H=K[1],O=(0,l.useState)(!1),Y=(0,a.A)(O,2),G=Y[0],Q=Y[1],U=(0,l.useState)(1),X=(0,a.A)(U,2),ee=X[0],se=X[1],te=(0,l.useState)(1),ae=(0,a.A)(te,2),le=ae[0],ie=ae[1],ne=10,re=()=>{const s={page:ee,limit:ne};"all"!==E&&(s.performanceTier=E),void 0!==W&&(s.isSuspended=W),e((0,C.ic)(s))},ce=()=>{e((0,C.Ln)({page:le,limit:ne}))};(0,l.useEffect)(()=>{re()},[ee,E,W]),(0,l.useEffect)(()=>{ce()},[le]);const de=async(s,t,a)=>{const l=window.user||{id:"admin"};await e((0,C.z_)({reportId:s,status:t,adminNotes:a,reviewedBy:l.id})),Q(!1),ce()},oe=e=>{switch(e){case"Elite":return"bg-yellow-100 text-yellow-800 border-yellow-200";case"Advanced":return"bg-green-100 text-green-800 border-green-200";case"Standard":return"bg-blue-100 text-blue-800 border-blue-200";default:return"bg-gray-100 text-gray-800 border-gray-200"}};return P&&!t.length?(0,S.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,S.jsxs)("div",{className:"text-center",children:[(0,S.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),(0,S.jsx)("p",{className:"mt-4 text-gray-600",children:"Loading monitoring data..."})]})}):(0,S.jsxs)("div",{className:"min-h-screen bg-gray-50",style:{textAlign:"left"},children:[(0,S.jsx)(w.A,{}),(0,S.jsx)("main",{className:"lg:pl-64 pt-16",children:(0,S.jsx)("div",{className:"p-6",children:(0,S.jsxs)("div",{className:"max-w-7xl mx-auto
1space-y-6",children:[(0,S.jsx)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:(0,S.jsxs)("div",{children:[(0,S.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:"Professional Monitoring"}),(0,S.jsx)("p",{className:"text-gray-600 mt-1",children:"Monitor professional performance and violations"})]})}),(0,S.jsxs)("div",{className:"flex gap-4 border-b",children:[(0,S.jsxs)("button",{onClick:()=>F("monitoring"),className:"pb-3 px-4 font-medium transition-colors "+("monitoring"===M?"border-b-2 border-blue-600 text-blue-600":"text-gray-600 hover:text-gray-900"),children:[(0,S.jsx)(v.A,{className:"h-4 w-4 inline mr-2"}),"Monitoring Data"]}),(0,S.jsxs)("button",{onClick:()=>F("reports"),className:"pb-3 px-4 font-medium transition-colors "+("reports"===M?"border-b-2 border-blue-600 text-blue-600":"text-gray-600 hover:text-gray-900"),children:[(0,S.jsx)(u.A,{className:"h-4 w-4 inline mr-2"}),"Client Reports (",R.length,")"]})]}),"monitoring"===M&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(N.Zp,{className:"p-4",children:(0,S.jsxs)("div",{className:"flex flex-wrap gap-4",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Performance Tier"}),(0,S.jsxs)("select",{value:E,onChange:e=>z(e.target.value),className:"px-3 py-2 border rounded-lg",children:[(0,S.jsx)("option",{value:"all",children:"All Tiers"}),(0,S.jsx)("option",{value:"Elite",children:"Elite"}),(0,S.jsx)("option",{value:"Advanced",children:"Advanced"}),(0,S.jsx)("option",{value:"Standard",children:"Standard"}),(0,S.jsx)("option",{value:"Basic",children:"Basic"})]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Status"}),(0,S.jsxs)("select",{value:void 0===W?"all":W?"suspended":"active",onChange:e=>_("all"===e.target.value?void 0:"suspended"===e.target.value),className:"px-3 py-2 border rounded-lg",children:[(0,S.jsx)("option",{value:"all",children:"All Status"}),(0,S.jsx)("option",{value:"active",children:"Active"}),(0,S.jsx)("option",{value:"suspended",children:"Suspended"})]})]})]})}),(0,S.jsx)("div",{className:"grid grid-cols-1 gap-4",children:t.map(s=>(0,S.jsxs)(N.Zp,{className:"p-6",children:[(0,S.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3",children:[(0,S.jsx)("div",{className:"p-2 rounded-lg "+("home_service"===s.professionalType?"bg-blue-100":"bg-purple-100"),children:"home_service"===s.professionalType?(0,S.jsx)(p.A,{className:"h-6 w-6 text-blue-600"}):(0,S.jsx)(f.A,{className:"h-6 w-6 text-purple-600"})}),(0,S.jsxs)("div",{children:[(0,S.jsx)("h3",{className:"font-semibold text-lg",children:(()=>{const e=s.userId;return null!==e&&void 0!==e&&e.firstName||null!==e&&void 0!==e&&e.lastName?`${e.firstName||""} ${e.lastName||""}`.trim():(null===e||void 0===e?void 0:e.email)||`ID: ${String((null===e||void 0===e?void 0:e._id)||e||"").substring(0,8)}...`})()}),(0,S.jsxs)("p",{className:"text-sm text-gray-600",children:["home_service"===s.professionalType?"Home Service":"Remote/Video",(()=>{const e=s.userId;return null!==e&&void 0!==e&&e.email?` | ${e.email}`:""})()]})]})]}),(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsxs)(y.E,{variant:void 0,className:`${oe(s.performanceTier)} border`,children:[(0,S.jsx)(m.A,{className:"h-3 w-3 mr-1"}),s.performanceTier]}),s.isSuspended&&(0,S.jsxs)(y.E,{variant:void 0,className:"bg-red-100 text-red-800 border-red-200",children:[(0,S.jsx)(x.A,{className:"h-3 w-3 mr-1"}),"Suspended"]})]})]}),(0,S.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[(0,S.jsxs)("div",{className:"p-3 bg-gray-50 rounded-lg",children:[(0,S.jsx)("p",{className:"text-xs text-gray-600 mb-1",children:"Trust Score"}),(0,S.jsx)("p",{className:"text-xl font-bold text-gray-900",children:s.trustScore})]}),(0,S.jsxs)("div",{className:"p-3 bg-blue-50 rounded-lg",children:[(0,S.jsx)("p",{className:"text-xs text-gray-600 mb-1",children:"home_service"===s.professionalType?"Home Visits":"Video Calls"}),(0,S.jsx)("p",{className:"text-xl font-bold text-blue-900",children:"home_service"===s.professionalType?s.totalHomeVisits:s.totalVideoCalls})]}),(0,S.jsxs)("div",{className:"p-3 bg-green-50 rounded-lg",children:[(0,S.jsx)("p",{className:"text-xs text-gray-600 mb-1",children:"Contracts Closed"}),(0,S.jsx)("p",{className:"text-xl font-bold text-green-900",children:"home_service"===s.professionalType?s.contractsClosedInPeriod:s.videoContractsClosedInPeriod})]}),(0,S.jsxs)("div",{className:"p-3 bg-yellow-50 rounded-lg",children:[(0,S.jsx)("p",{className:"text-xs text-gray-600 mb-1",children:"Warnings"}),(0,S.jsx)("p",{className:"text-xl font-bold text-yellow-900",children:s.totalWarnings})]})]}),(0,S.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsx)(r.A,{className:"h-4 w-4 text-gray-500"}),(0,S.jsxs)("span",{className:"text-gray-600",children:["Reports: ",(0,S.jsx)("strong",{children:s.confirmedReports})]})]}),(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsx)(j.A,{className:"h-4 w-4 text-gray-500"}),(0,S.jsxs)("span",{className:"text-gray-600",children:["Compliant Months: ",(0,S.jsx)("strong",{children:s.compliantMonthsInRow})]})]}),(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsx)(c.A,{className:"h-4 w-4 text-gray-500"}),(0,S.jsxs)("span",{className:"text-gray-600",children:["Anomalies: ",(0,S.jsx)("strong",{children:s.anomalyCount})]})]}),(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsx)(d.A,{className:"h-4 w-4 text-purple-500"}),(0,S.jsxs)("span",{className:"text-gray-600",children:["Refund Requests: ",(0,S.jsx)("strong",{children:s.totalRefundRequests||0})]})]})]}),s.isSuspended&&(0,S.jsx)("div",{className:"mt-4 p-3 bg-red-50 border border-red-200 rounded-lg",children:(0,S.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,S.jsxs)("div",{className:"flex items-start gap-2 flex-1",children:[(0,S.jsx)(x.A,{className:"h-5 w-5 text-red-600 mt-0.5 flex-shrink-0"}),(0,S.jsxs)("div",{className:"text-sm",children:[(0,S.jsx)("p",{className:"font-medium text-red-900",children:"Suspended"}),(0,S.jsx)("p",{className:"text-red-700",children:s.suspensionReason}),s.suspensionEndDate&&!s.isPermanentlyBanned&&(0,S.jsxs)("p",{className:"text-red-600 mt-1",children:["Ends: ",(0,i.lH)(s.suspensionEndDate)]}),s.isPermanentlyBanned&&(0,S.jsx)("p",{className:"text-red-600 mt-1 font-medium",children:"Permanent Suspension"})]})]}),(0,S.jsxs)(b.$,{size:"sm",variant:"outline",onClick:()=>{(async s=>{if(window.confirm("Are you sure you want to reactivate this professional's account?\n\nThis will:\n\u2013 Remove suspension\n\u2013 Reset home visits to 0\n\u2013 Reset warnings to 0\n\u2013 Reset anomalies to 0\n\u2013 Dism
1iss all active warnings\n\nDo you want to continue?"))try{await e((0,C.Qr)(s)).unwrap(),re()}catch(t){console.error("Failed to reactivate account:",t)}})("object"===typeof s.userId&&null!==s.userId?s.userId.id||s.userId._id:s.userId)},className:"bg-green-50 text-green-700 border-green-300 hover:bg-green-100 flex-shrink-0",children:[(0,S.jsx)(c.A,{className:"h-4 w-4 mr-1"}),"Reactivate"]})]})})]},s.id))}),0===t.length&&(0,S.jsx)(N.Zp,{className:"p-12",children:(0,S.jsxs)("div",{className:"text-center",children:[(0,S.jsx)(v.A,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),(0,S.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"No Monitoring Data"}),(0,S.jsx)("p",{className:"text-gray-600",children:"No professional monitoring data found with the selected filters."})]})}),A&&(0,S.jsx)(N.Zp,{className:"p-4",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"text-sm text-gray-600",children:["Showing ",(A.currentPage-1)*ne+1," - ",Math.min(A.currentPage*ne,A.totalCount)," of ",A.totalCount," professionals"]}),(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsx)(b.$,{variant:"outline",size:"sm",onClick:()=>se(e=>e-1),disabled:!A.hasPreviousPage,children:"Previous"}),(0,S.jsxs)("div",{className:"text-sm text-gray-600",children:["Page ",A.currentPage," of ",A.totalPages]}),(0,S.jsx)(b.$,{variant:"outline",size:"sm",onClick:()=>se(e=>e+1),disabled:!A.hasNextPage,children:"Next"})]})]})})]}),"reports"===M&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"grid grid-cols-1 gap-4",children:R.map(e=>(0,S.jsxs)(N.Zp,{className:"p-6",children:[(0,S.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,S.jsxs)("div",{children:[(0,S.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,S.jsx)(o.A,{className:"h-5 w-5 text-orange-600"}),(0,S.jsx)("h3",{className:"font-semibold text-lg capitalize",children:e.reportType.replace(/_/g," ")})]}),(0,S.jsxs)("p",{className:"text-sm text-gray-600",children:[(0,S.jsx)("span",{className:"font-medium",children:"Professional:"})," ",(()=>{const s=e.professionalId;return null!==s&&void 0!==s&&s.firstName||null!==s&&void 0!==s&&s.lastName?`${s.firstName||""} ${s.lastName||""}`.trim():(null===s||void 0===s?void 0:s.email)||`ID: ${String((null===s||void 0===s?void 0:s._id)||s||"").substring(0,12)}...`})()]}),(0,S.jsxs)("p",{className:"text-sm text-gray-600",children:[(0,S.jsx)("span",{className:"font-medium",children:"Client:"})," ",(()=>{const s=e.clientId;return null!==s&&void 0!==s&&s.firstName||null!==s&&void 0!==s&&s.lastName?`${s.firstName||""} ${s.lastName||""}`.trim():(null===s||void 0===s?void 0:s.email)||`ID: ${String((null===s||void 0===s?void 0:s._id)||s||"").substring(0,12)}...`})()]})]}),(0,S.jsx)(y.E,{variant:void 0,className:"confirmed"===e.status?"bg-red-100 text-red-800":"rejected"===e.status?"bg-gray-100 text-gray-800":"investigating"===e.status?"bg-blue-100 text-blue-800":"bg-yellow-100 text-yellow-800",children:e.status})]}),(0,S.jsx)("div",{className:"mb-4",children:(0,S.jsx)("p",{className:"text-gray-700",children:e.description})}),e.adminNotes&&(0,S.jsxs)("div",{className:"mb-4 p-3 bg-blue-50 rounded-lg",children:[(0,S.jsx)("p",{className:"text-sm font-medium text-blue-900 mb-1",children:"Admin Notes:"}),(0,S.jsx)("p",{className:"text-sm text-blue-800",children:e.adminNotes})]}),(0,S.jsxs)("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[(0,S.jsxs)("span",{children:["Submitted: ",new Date(e.createdAt).toLocaleString()]}),"pending"===e.status&&(0,S.jsx)("div",{className:"flex gap-2",children:(0,S.jsxs)(b.$,{size:"sm",variant:"outline",onClick:()=>{H(e),Q(!0)},children:[(0,S.jsx)(g.A,{className:"h-4 w-4 mr-1"}),"Review"]})})]})]},e.id))}),0===R.length&&(0,S.jsx)(N.Zp,{className:"p-12",children:(0,S.jsxs)("div",{className:"text-center",children:[(0,S.jsx)(u.A,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),(0,S.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"No Reports"}),(0,S.jsx)("p",{className:"text-gray-600",children:"No customer reports have been submitted yet."})]})}),k&&k.totalPages>1&&(0,S.jsx)(N.Zp,{className:"p-4",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"text-sm text-gray-600",children:["Showing ",(k.currentPage-1)*ne+1," - ",Math.min(k.currentPage*ne,k.totalCount)," of ",k.totalCount," reports"]}),(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsx)(b.$,{variant:"outline",size:"sm",onClick:()=>ie(e=>e-1),disabled:!k.hasPreviousPage,children:"Previous"}),(0,S.jsxs)("div",{className:"text-sm text-gray-600",children:["Page ",k.currentPage," of ",k.totalPages]}),(0,S.jsx)(b.$,{variant:"outline",size:"sm",onClick:()=>ie(e=>e+1),disabled:!k.hasNextPage,children:"Next"})]})]})})]})]})})}),G&&L&&(0,S.jsx)("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:(0,S.jsxs)("div",{className:"bg-white rounded-xl max-w-2xl w-full",children:[(0,S.jsx)("div",{className:"p-6 border-b",children:(0,S.jsx)("h2",{className:"text-xl font-semibold",children:"Review Report"})}),(0,S.jsxs)("div",{className:"p-6 space-y-4",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Report Type"}),(0,S.jsx)("p",{className:"p-3 bg-gray-50 rounded-lg capitalize",children:L.reportType.replace(/_/g," ")})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Description"}),(0,S.jsx)("p",{className:"p-3 bg-gray-50 rounded-lg",children:L.description})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Decision"}),(0,S.jsxs)("div",{className:"flex gap-3",children:[(0,S.jsxs)(b.$,{onClick:()=>de(L.id,"confirmed","Report confirmed after review"),className:"flex-1 bg-red-600 hover:bg-red-700 text-white",children:[(0,S.jsx)(c.A,{className:"h-4 w-4 mr-2"}),"Confirm Violation"]}),(0,S.jsxs)(b.$,{onClick:()=>de(L.id,"rejected","Report rejected after review"),variant:"outline",className:"flex-1",children:[(0,S.jsx)(d.A,{className:"h-4 w-4 mr-2"}),"Reject Report"]}),(0,S.jsxs)(b.$,{onClick:()=>de(L.id,"investigating","Under investigation"),variant:"outline",className:"flex-1",children:[(0,S.jsx)(h.A,{className:"h-4 w-4 mr-2"}),"Investigate"]})]})]})]}),(0,S.jsx)("div",{className:"p-6 border-t flex justify-end gap-3",children:(0,S.jsx)(b.$,{variant:"outline",onClick:()=>Q(!1),children:"Cancel"})})]})})]})};t.d(s,["default",0,A])},86301(e,s,t){t.r(s);var a=t(5544),l=t(9950),i=t(10300),n=t(21100),r=t(14703),c=t(79585),d=t(53034),o=t(68108),m=t(90983),x=t(45536),h=t(27255),g=t(31855),u=t(7192),p=t(13147),j=t(81946),v=t(2263),f=t(56149),N=t(96479),b=t(16255),y=t(42461),w=t(60348),C=t(2700),S=t(1478),A=t(44414);const R=()=>{const e=(0,i.wA)(),s=(0,i.d4)(e=>e.adminProfessionalScoring),R=s.rankings,k=s.rankingsLoading,P=s.rankingsError,T=(0,l.useState)(""),$=(0,a.A)(T,2),M=$[0],F=$[1],I=(0,l.useState)(""),D=(0,a.A)(I,2),E=D[0],z=D[1],V=(0,l.useState)("month"),B=(0,a.A)(V,2),W=B[0],_=B[1],Z=(0,l.useState)(1),q=(0,a.A)(Z,2),J=q[0],K=q[1],L=(0,l.useState)(10),H=(0,a.A)(L,1)[0],O
1=(0,l.useRef)(null);(0,l.useEffect)(()=>(O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{z(M)},500),()=>{O.current&&clearTimeout(O.current)}),[M]),(0,l.useEffect)(()=>{e((0,S.z$)({page:J,limit:H,search:E||void 0,timeframe:W}))},[e,J,H,E,W]);const Y=(null===R||void 0===R?void 0:R.rankings)||[],G=(null===R||void 0===R?void 0:R.totalCount)||0,Q=(null===R||void 0===R?void 0:R.totalPages)||1,U=(null===R||void 0===R||R.hasNextPage,(J-1)*H),X=Math.min(U+H,G);(0,l.useEffect)(()=>{K(1)},[E,W]);if(k)return(0,A.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,A.jsxs)("div",{className:"text-center",children:[(0,A.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),(0,A.jsx)("p",{className:"mt-4 text-gray-600",children:"Loading rankings..."})]})});if(P)return(0,A.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,A.jsxs)("div",{className:"text-center",children:[(0,A.jsx)("p",{className:"text-red-600 mb-4",children:P}),(0,A.jsx)("button",{onClick:()=>e((0,S.z$)({page:J,limit:H,search:E||void 0,timeframe:W})),className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700",children:"Retry"})]})});const ee=()=>{switch(W){case"quarter":return"This Quarter";case"year":return"This Year";default:return"This Month"}},se=e=>{let s=e.professional;return(0,A.jsxs)(b.Zp,{className:"p-4 sm:p-6 hover:shadow-md transition-shadow",style:{textAlign:"left"},children:[(0,A.jsx)("div",{className:"flex flex-col sm:flex-row justify-between items-start gap-4",children:(0,A.jsxs)("div",{className:"flex items-center gap-3 sm:gap-4",children:[(0,A.jsx)("div",{className:"h-10 sm:h-12 w-10 sm:w-12 rounded-full flex items-center justify-center "+(1===s.rank.overall?"bg-yellow-100":2===s.rank.overall?"bg-gray-100":"bg-orange-100"),children:1===s.rank.overall?(0,A.jsx)(f.A,{className:"h-5 sm:h-6 w-5 sm:w-6 text-yellow-600"}):2===s.rank.overall?(0,A.jsx)(u.A,{className:"h-5 sm:h-6 w-5 sm:w-6 text-gray-600"}):(0,A.jsx)(u.A,{className:"h-5 sm:h-6 w-5 sm:w-6 text-orange-600"})}),(0,A.jsxs)("div",{children:[(0,A.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,A.jsx)("h3",{className:"font-semibold text-base sm:text-lg",children:s.name}),(0,A.jsxs)(w.E,{variant:void 0,className:"bg-blue-100 text-blue-700 text-xs sm:text-sm",children:["#",s.rank.overall]}),"up"===s.rank.trend?(0,A.jsx)(w.E,{variant:void 0,className:"bg-green-100 text-green-700",children:(0,A.jsx)(d.A,{className:"h-3 w-3"})}):(0,A.jsx)(w.E,{variant:void 0,className:"bg-red-100 text-red-700",children:(0,A.jsx)(r.A,{className:"h-3 w-3"})})]}),(0,A.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs sm:text-sm text-gray-600 mt-1",children:[(0,A.jsx)("span",{children:s.profession}),(0,A.jsx)("span",{children:"\u2022"}),(0,A.jsxs)("div",{className:"flex items-center gap-1",children:[(0,A.jsx)(g.A,{className:"h-3 sm:h-4 w-3 sm:w-4"}),s.region]})]})]})]})}),(0,A.jsxs)("div",{className:"mt-4 sm:mt-6 grid grid-cols-2 sm:grid-cols-3 gap-3 sm:gap-4",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("div",{className:"text-xs sm:text-sm text-gray-500",children:"Rating"}),(0,A.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,A.jsx)("div",{className:"text-base sm:text-xl font-semibold",children:s.metrics.rating}),(0,A.jsx)(v.A,{className:"h-4 sm:h-5 w-4 sm:w-5 text-yellow-400 fill-current"})]})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("div",{className:"text-xs sm:text-sm text-gray-500",children:"Total Jobs"}),(0,A.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,A.jsx)("div",{className:"text-base sm:text-xl font-semibold",children:s.metrics.totalJobs}),(0,A.jsx)(w.E,{variant:void 0,className:"bg-green-100 text-green-700 text-xs",children:s.performance.trend.jobs})]})]}),(0,A.jsxs)("div",{className:"col-span-2 sm:col-span-1",children:[(0,A.jsx)("div",{className:"text-xs sm:text-sm text-gray-500",children:"Revenue"}),(0,A.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,A.jsx)("div",{className:"text-base sm:text-xl font-semibold",children:s.metrics.revenue}),(0,A.jsx)(w.E,{variant:void 0,className:"bg-green-100 text-green-700 text-xs",children:s.performance.trend.revenue})]})]})]}),s.achievements&&s.achievements.length>0&&(0,A.jsxs)("div",{className:"mt-4 sm:mt-6",children:[(0,A.jsx)("div",{className:"text-xs sm:text-sm text-gray-500 mb-2",children:"Achievements"}),(0,A.jsx)("div",{className:"flex flex-wrap gap-2",children:s.achievements.map((e,s)=>(0,A.jsxs)(w.E,{variant:void 0,className:"flex items-center gap-1 text-xs "+("crown"===e.type?"bg-yellow-100 text-yellow-700":"star"===e.type?"bg-blue-100 text-blue-700":"bg-green-100 text-green-700"),children:["crown"===e.type?(0,A.jsx)(x.A,{className:"h-3 w-3"}):"star"===e.type?(0,A.jsx)(v.A,{className:"h-3 w-3"}):(0,A.jsx)(j.A,{className:"h-3 w-3"}),e.label]},s))})]}),(0,A.jsxs)("div",{className:"mt-4 sm:mt-6 pt-4 sm:pt-6 border-t",children:[(0,A.jsxs)("div",{className:"text-xs sm:text-sm text-gray-500 mb-2",children:[ee(),"'s Performance"]}),(0,A.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3 sm:gap-4",children:[(0,A.jsxs)("div",{className:"p-2 sm:p-3 bg-gray-50 rounded-lg",children:[(0,A.jsx)("div",{className:"text-xs sm:text-sm text-gray-500",children:"Jobs"}),(0,A.jsx)("div",{className:"mt-1 text-sm sm:text-base font-semibold",children:s.performance.thisMonth.jobs})]}),(0,A.jsxs)("div",{className:"p-2 sm:p-3 bg-gray-50 rounded-lg",children:[(0,A.jsx)("div",{className:"text-xs sm:text-sm text-gray-500",children:"Revenue"}),(0,A.jsx)("div",{className:"mt-1 text-sm sm:text-base font-semibold",children:s.performance.thisMonth.revenue})]}),(0,A.jsxs)("div",{className:"col-span-2 sm:col-span-1 p-2 sm:p-3 bg-gray-50 rounded-lg",children:[(0,A.jsx)("div",{className:"text-xs sm:text-sm text-gray-500",children:"Rating"}),(0,A.jsx)("div",{className:"mt-1 text-sm sm:text-base font-semibold",children:s.performance.thisMonth.rating})]})]})]})]})};return(0,A.jsxs)("div",{className:"min-h-screen bg-gray-50 flex flex-col",style:{textAlign:"left"},children:[(0,A.jsx)(C.A,{}),(0,A.jsx)("main",{className:"flex-1 lg:pl-64 pt-16",children:(0,A.jsx)("div",{className:"p-3 sm:p-6",children:(0,A.jsxs)("div",{className:"max-w-7xl mx-auto
1space-y-4 sm:space-y-6",children:[(0,A.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 sm:gap-4",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("h1",{className:"text-xl sm:text-2xl font-bold text-gray-900",children:"Rankings"}),(0,A.jsx)("p",{className:"text-sm sm:text-base text-gray-600 mt-1",children:"View and analyze professional rankings"})]}),(0,A.jsxs)(y.$,{variant:"outline",className:"flex items-center gap-2 text-sm w-full sm:w-auto",onClick:async()=>{if(!Y||0===Y.length)return void alert("No ranking data available to export");const e=(await Promise.all([t.e(7514),t.e(359),t.e(4400),t.e(6770),t.e(1370),t.e(2255),t.e(6310),t.e(5269),t.e(2384),t.e(8691),t.e(5043),t.e(8732),t.e(5599),t.e(2678),t.e(1811),t.e(7098)]).then(t.bind(t,74962))).jsPDF,s=(await Promise.all([t.e(7514),t.e(359),t.e(4400),t.e(6770),t.e(1370),t.e(2255),t.e(6310),t.e(5269),t.e(2384),t.e(8691),t.e(5043),t.e(8732),t.e(5599),t.e(2678),t.e(1811),t.e(7098)]).then(t.bind(t,74620))).default,a=new e,l=a.internal.pageSize.width;a.setFontSize(20),a.setTextColor(99,102,241),a.text("Professional Rankings Report",l/2,20,{align:"center"}),a.setFontSize(10),a.setTextColor(100,100,100),a.text(`Generated: ${(new Date).toLocaleString()}`,l/2,28,{align:"center"}),a.text(`Total Professionals: ${G}`,l/2,34,{align:"center"}),a.text(`Timeframe: ${ee()}`,l/2,40,{align:"center"});let i=50;a.setFontSize(12),a.setTextColor(0,0,0),a.text("Overall Ranking Summary",14,i),i+=5;const n=[["Metric","Value"],["Top Performers",`${(null===R||void 0===R?void 0:R.topPerformers)||0}`],["Rising Stars",`${(null===R||void 0===R?void 0:R.risingStars)||0}`],["Categories",`${(null===R||void 0===R?void 0:R.categories)||0}`],["Regions",`${(null===R||void 0===R?void 0:R.regions)||0}`]];s(a,{startY:i,head:[n[0]],body:n.slice(1),theme:"striped",headStyles:{fillColor:[99,102,241]},margin:{left:14,right:14}}),i=a.lastAutoTable.finalY+15,a.setFontSize(12),a.text("Professional Rankings Details",14,i),i+=5;const r=[["Rank","Name","Profession","Region","Rating","Jobs","Revenue","Trend"],...Y.map(e=>[`#${e.rank.overall}`,e.name.substring(0,20),e.profession.substring(0,15),e.region.substring(0,15),`${e.metrics.rating}/5`,e.metrics.totalJobs.toString(),e.metrics.revenue,"up"===e.rank.trend?"\u2191":"\u2193"])];s(a,{startY:i,head:[r[0]],body:r.slice(1),theme:"striped",headStyles:{fillColor:[99,102,241]},margin:{left:14,right:14},styles:{fontSize:8}}),i=a.lastAutoTable.finalY+15,i>250&&(a.addPage(),i=20),a.setFontSize(12),a.text(`${ee()}'s Performance Details`,14,i),i+=5;const c=[["Name","Jobs","Revenue","Rating"],...Y.map(e=>[e.name.substring(0,25),e.performance.thisMonth.jobs.toString(),e.performance.thisMonth.revenue,e.performance.thisMonth.rating.toString()])];s(a,{startY:i,head:[c[0]],body:c.slice(1),theme:"striped",headStyles:{fillColor:[99,102,241]},margin:{left:14,right:14},styles:{fontSize:9}});const d=a.internal.getNumberOfPages();for(let t=1;t<=d;t++)a.setPage(t),a.setFontSize(8),a.setTextColor(150),a.text(`Page ${t} of ${d}`,l/2,a.internal.pageSize.height-10,{align:"center"});a.save(`kokobeo_rankings_${W}_${(new Date).toISOString().split("T")[0]}.pdf`)},disabled:!Y||0===Y.length,children:[(0,A.jsx)(h.A,{className:"h-4 w-4"}),"Export Rankings"]})]}),(0,A.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-4",children:[(0,A.jsx)(b.Zp,{className:"p-4 sm:p-6",children:(0,A.jsxs)("div",{className:"flex justify-between items-start",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"text-xs sm:text-sm text-gray-500",children:"Top Performers"}),(0,A.jsx)("p",{className:"text-lg sm:text-2xl font-semibold mt-1",children:(null===R||void 0===R?void 0:R.topPerformers)||0})]}),(0,A.jsx)("div",{className:"p-2 bg-yellow-100 rounded-lg",children:(0,A.jsx)(f.A,{className:"h-4 sm:h-5 w-4 sm:w-5 text-yellow-600"})})]})}),(0,A.jsx)(b.Zp,{className:"p-4 sm:p-6",children:(0,A.jsxs)("div",{className:"flex justify-between items-start",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"text-xs sm:text-sm text-gray-500",children:"Rising Stars"}),(0,A.jsx)("p",{className:"text-lg sm:text-2xl font-semibold mt-1",children:(null===R||void 0===R?void 0:R.risingStars)||0})]}),(0,A.jsx)("div",{className:"p-2 bg-blue-100 rounded-lg",children:(0,A.jsx)(c.A,{className:"h-4 sm:h-5 w-4 sm:w-5 text-blue-600"})})]})}),(0,A.jsx)(b.Zp,{className:"p-4 sm:p-6",children:(0,A.jsxs)("div",{className:"flex justify-between items-start",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"text-xs sm:text-sm text-gray-500",children:"Categories"}),(0,A.jsx)("p",{className:"text-lg sm:text-2xl font-semibold mt-1",children:(null===R||void 0===R?void 0:R.categories)||0})]}),(0,A.jsx)("div",{className:"p-2 bg-purple-100 rounded-lg",children:(0,A.jsx)(n.A,{className:"h-4 sm:h-5 w-4 sm:w-5 text-purple-600"})})]})}),(0,A.jsx)(b.Zp,{className:"p-4 sm:p-6",children:(0,A.jsxs)("div",{className:"flex justify-between items-start",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"text-xs sm:text-sm text-gray-500",children:"Regions"}),(0,A.jsx)("p",{className:"text-lg sm:text-2xl font-semibold mt-1",children:(null===R||void 0===R?void 0:R.regions)||0})]}),(0,A.jsx)("div",{className:"p-2 bg-green-100 rounded-lg",children:(0,A.jsx)(g.A,{className:"h-4 sm:h-5 w-4 sm:w-5 text-green-600"})})]})})]}),(0,A.jsx)(b.Zp,{className:"p-3 sm:p-4",children:(0,A.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between gap-3 sm:gap-4",children:[(0,A.jsxs)("div",{className:"relative flex-1",children:[(0,A.jsx)(p.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 sm:h-5 w-4 sm:w-5 text-gray-400"}),(0,A.jsx)("input",{type:"text",placeholder:"Search professionals by name or profession...",value:M,onChange:e=>{F(e.target.value)},className:"w-full pl-10 pr-10 py-2 border rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"}),M&&(0,A.jsx)("button",{onClick:()=>{F("")},className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600","aria-label":"Clear search",children:(0,A.jsx)(N.A,{className:"h-4 sm:h-5 w-4 sm:w-5"})})]}),E&&E!==M&&(0,A.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[(0,A.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"}),(0,A.jsx)("span",{children:"Searching..."})]}),(0,A.jsxs)("select",{value:W,onChange:e=>_(e.target.value),className:"px-4 py-2 border rounded-lg text-sm bg-white focus:outline-none focus:ring-2 focus:ring-blue-500",children:[(0,A.jsx)("option",{value:"month",children:"This Month"}),(0,A.jsx)("option",{value:"quarter",children:"This Quarter"}),(0,A.jsx)("option",{value:"year",children:"This Year"})]})]})}),(0,A.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 sm:gap-6",children:Y.length>0?Y.map(e=>(0,A.jsx)(se,{professional:e},e.id)):(0,A.jsx)("div",{className:"col-span-2 text-center py-12",children:(0,A.jsx)("p",{className:"text-gray-500",children:"No rankings found matching your criteria"})})}),Q>1&&(0,A.jsx)(b.Zp,{className:"p-4",children:(0,A.jsxs)("div",{className:"flex items-center justify-between",children:[(0,A.jsxs)("div",{className:"text-sm text-gray-600",children:["Showing ",U+1," to ",X," of ",G," professionals"]}),(0,A.jsxs)("div",{className:"flex items-center gap-2",children:[(0,A.jsxs)(y.$,{variant:"outline",size:"sm",onClick:()=>K(e=>Math.max(e-1,1)),disabled:1===J,className:"flex items-center gap-1",children:[(0,A.jsx)(o.A,{className:"h-4 w-4"}),"Previous"]}),(0,A.jsx)("div",{className:"flex items-center gap-1",children:Array.from({length:Q},(e,s)=>s+1).map(e=>1===e||e===Q||e>=J-1&&e<=J+1?(0,A.jsx)("button",{onClick:()=>K(e),className:"px-3 py-1 rounded "+(J===e?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:e},e):e===J-2||e===J+2?(0,A.jsx)("span",{className:"px-2",children:"..."},e):null)}),(0,A.jsxs)(y.$,{variant:"outline",size:"sm",onClick:()=>K(e=>Math.min(e+1,Q)),disabled:J===Q,className:"flex items-center gap-1",children:["Next",(0,A.jsx)(m.A,{className:"h-4 w-4"})]})]})]})})]})})})]})};t.d(s,["default",0,R])},41798(e,s,t){t.r(s);var a=t(5544),l=t(9950),i=t(10300),n=t(52828),r=t(45833),c=t(78130),d=t(77737),o=t(16859),m=t(71742),x=t(89318),h=t(81946),g=t(2263),u=t(47770),p=t(6890),j=t(55120),v=t(96479),f=t(25692),N=t(16255),b=t(42461),y=t(60348),w=t(2700),C=t(12810),S=t(72310),A=t(44414);const R=e=>{let s=e.isOpen,t=e.onClose,i=e.achievementConfigs,n=e.selectedAchievementType,r=e.setSelectedAchievementType,d=e.dispatch;const o=i.find(e=>e.configKey===n),x=(0,l.useState)((null===o||void 0===o?void 0:o.thresholds)||{}),h=(0,a.A)(x,2),u=h[0],p=h[1];if((0,l.useEffect)(()=>{const e=i.find(e=>e.configKey===n);e&&p(e.thresholds)},[n,i]),!s)return null;return(0,A.jsx)("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:(0,A.jsxs)("div",{className:"bg-white rounded-xl max-w-3xl w-full max-h-[90vh] overflow-y-auto",children:[(0,A.jsxs)("div",{className:"p-6 border-b sticky top-0 bg-white z-10",children:[(0,A.jsxs)("div",{className:"flex items-center justify-between",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("h2",{className:"text-xl font-semibold",children:"Achievement Configuration"}),(0,A.jsxs)("p",{className:"text-sm text-gray-600 mt-1",children:["Set thresholds for ","professional"===n?"Professional":"Client"," achievements"]})]}),(0,A.jsx)("button",{onClick:t,className:"p-2 hover:bg-gray-100 rounded-full",children:(0,A.jsx)(v.A,{className:"h-5 w-5"})})]}),(0,A.jsxs)("div",{className:"flex gap-2 mt-4",children:[(0,A.jsxs)(b.$,{variant:"professional"===n?"default":"outline",onClick:()=>r("professional"),className:"flex-1",children:[(0,A.jsx)(c.A,{className:"h-4 w-4 mr-2"}),"Professional"]}),(0,A.jsxs)(b.$,{variant:"client"===n?"default":"outline",onClick:()=>r("client"),className:"flex-1",children:[(0,A.jsx)(g.A,{className:"h-4 w-4 mr-2"}),"Client"]})]})]}),(0,A.jsx)("div",{className:"p-6 space-y-6",style:{textAlign:"left"},children:"professional"===n?(0,A.jsx)(A.Fragment,{children:(0,A.jsxs)("div",{children:[(0,A.jsx)("h3",{className:"font-semibold text-lg mb-4",children:"Professional Achievement Thresholds"}),(0,A.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Top Earner - Amount (\u20ac)"}),(0,A.jsx)("input",{type:"number",value:u.topEarnerAmount||1e4,onChange:e=>p({...u,topEarnerAmount:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Minimum earnings to unlock Top Earner"})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Expert Professional - Projects"}),(0,A.jsx)("input",{type:"number",value:u.expertProjectsCount||10,onChange:e=>p({...u,expertProjectsCount:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Completed projects to unlock Expert"})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Rising Star - Projects"}),(0,A.jsx)("input",{type:"number",value:u.risingStarProjectsCount||5,onChange:e=>p({...u,risingStarProjectsCount:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Projects needed for Rising Star"})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Rising Star - Min Rating"}),(0,A.jsx)("input",{type:"number",step:"0.1",value:u.risingStarMinRating||4.5,onChange:e=>p({...u,risingStarMinRating:parseFloat(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"0",max:"5"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Minimum rating for Rising Star"})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Highly Rated - Reviews"}),(0,A.jsx)("input",{type:"number",value:u.highlyRatedReviewsCount||10,onChange:e=>p({...u,highlyRatedReviewsCount:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Reviews needed for Highly Rated"})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Highly Rated - Min Rating"}),(0,A.jsx)("input",{type:"number",step:"0.1",value:u.highlyRatedMinRating||4.7,onChange:e=>p({...u,highlyRatedMinRating:parseFloat(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"0",max:"5"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Minimum rating for Highly Rated"})]})]})]})}):(0,A.jsx)(A.Fragment,{children:(0,A.jsxs)("div",{children:[(0,A.jsx)("h3",{className:"font-semibold text-lg mb-4",children:"Client Achievement Thresholds"}),(0,A.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Top Client - Spent Amount (\u20ac)"}),(0,A.jsx)("input",{type:"number",value:u.topClientSpentAmount||1e4,onChange:e=>p({...u,topClientSpentAmount:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Minimum spending for Top Client"})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Top Client - Success Rate (%)"}),(0,A.jsx)("input",{type:"number",value:u.topClientSuccessRate||80,onChange:e=>p({...u,topClientSuccessRate:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"0",max:"100"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Required success rate for Top Client"})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Power Client - Projects"}),(0,A.jsx)("input",{type:"number",value:u.powerClientProjectsCount||10,onChange:e=>p({...u,powerClientProjectsCount:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Completed projects for Power Client"})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Team Builder - Projects"}),(0,A.jsx)("input",{type:"number",value:u.teamBuilderProjectsCount||5,onChange:e=>p({...u,teamBuilderProjectsCount:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Projects needed for Team Builder"})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Team Builder - Success Rate (%)"}),(0,A.jsx)("input",{type:"number",value:u.teamBuilderSuccessRate||90,onChange:e=>p({...u,teamBuilderSuccessRate:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"0",max:"100"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Required success rate for Team Builder"})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Trusted Reviewer - Reviews"}),(0,A.jsx)("input",{type:"number",value:u.trustedReviewerCount||10,onChange:e=>p({...u,trustedReviewerCount:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Reviews needed for Trusted Reviewer"})]})]})]})})}),(0,A.jsxs)("div",{className:"p-6 border-t bg-gray-50 flex justify-end gap-3",children:[(0,A.jsx)(b.$,{variant:"outline",onClick:t,children:"Cancel"}),(0,A.jsxs)(b.$,{onClick:async()=>{try{await d((0,S.ZO)({configKey:n,thresholds:u})).unwrap(),await d((0,S.Ib)()),t()}catch(e){}},className:"bg-blue-600 hover:bg-blue-700",children:[(0,A.jsx)(m.A,{className:"h-4 w-4 mr-2"}),"Save Changes"]})]})]})})},k=()=>{var e,s,t,k,P;const T=(0,i.wA)(),$=(0,i.d4)(e=>e.professionalMonitoring),M=$.configs,F=$.allMonitoringData,I=$.monitoringPagination,D=$.loading,E=(0,i.d4)(
1e=>e.achievements).allConfigs,z=(0,l.useState)(!1),V=(0,a.A)(z,2),B=V[0],W=V[1],_=(0,l.useState)(!1),Z=(0,a.A)(_,2),q=Z[0],J=Z[1],K=(0,l.useState)("home_service"),L=(0,a.A)(K,2),H=L[0],O=L[1],Y=(0,l.useState)("professional"),G=(0,a.A)(Y,2),Q=G[0],U=G[1];(0,l.useEffect)(()=>{T((0,C.xl)()),T((0,C.ic)({page:1,limit:9999})),T((0,S.Ib)())},[T]);const X={totalProfessionals:(null===I||void 0===I?void 0:I.totalCount)||(null===F||void 0===F?void 0:F.length)||0,activeProfessionals:(null===F||void 0===F||null===(e=F.filter(e=>!e.isSuspended))||void 0===e?void 0:e.length)||0,suspendedProfessionals:(null===F||void 0===F||null===(s=F.filter(e=>e.isSuspended))||void 0===s?void 0:s.length)||0,averageTrustScore:(null===F||void 0===F?void 0:F.length)>0?Math.round(F.reduce((e,s)=>e+s.trustScore,0)/F.length):0,eliteProfessionals:(null===F||void 0===F||null===(t=F.filter(e=>"Elite"===e.performanceTier))||void 0===t?void 0:t.length)||0};if(D&&!M.length)return(0,A.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,A.jsxs)("div",{className:"text-center",children:[(0,A.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),(0,A.jsx)("p",{className:"mt-4 text-gray-600",children:"Loading monitoring settings..."})]})});const ee=e=>{let s=e.isOpen,t=e.onClose;const i=M.find(e=>e.configKey===H),r=(0,l.useState)(i||{consecutiveVisitsWarningThreshold:3,totalVisitsForConversionCheck:10,minimumContractsRequired:3,consecutiveVideoCallsWarningThreshold:5,totalVideoCallsForConversionCheck:10,minimumConversionRatePercent:20,minimumCompletionRatePercent:30,reportsForFirstWarning:1,reportsForSuspension:2,reportsForPermanentBan:3,contactSharingForFirstWarning:1,contactSharingForSuspension:2,contactSharingForBan:3,consecutiveRefundRequestsForSuspension:3,firstSuspensionDays:7,secondSuspensionDays:14,pointsDeductedPerWarning:-25,trustBonusPoints:20,compliantMonthsForBonus:3,warningRepeatDays:7,monthlyResetDays:30,categoryRevenueThresholds:{}}),o=(0,a.A)(r,2),h=o[0],g=o[1];if((0,l.useEffect)(()=>{const e=M.find(e=>e.configKey===H);e&&g(e)},[H]),!s)return null;return(0,A.jsx)("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:(0,A.jsxs)("div",{className:"bg-white rounded-xl max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[(0,A.jsxs)("div",{className:"p-6 border-b sticky top-0 bg-white z-10",children:[(0,A.jsxs)("div",{className:"flex items-center justify-between",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("h2",{className:"text-xl font-semibold",children:"Automated Monitoring Configuration"}),(0,A.jsxs)("p",{className:"text-sm text-gray-600 mt-1",children:["Configure thresholds and rules for ","home_service"===H?"Home Service":"Remote"," Professionals"]})]}),(0,A.jsx)("button",{onClick:t,className:"p-2 hover:bg-gray-100 rounded-full",children:(0,A.jsx)(v.A,{className:"h-5 w-5"})})]}),(0,A.jsxs)("div",{className:"flex gap-2 mt-4",children:[(0,A.jsxs)(b.$,{variant:"home_service"===H?"default":"outline",onClick:()=>O("home_service"),className:"flex-1",children:[(0,A.jsx)(u.A,{className:"h-4 w-4 mr-2"}),"Home Service"]}),(0,A.jsxs)(b.$,{variant:"remote"===H?"default":"outline",onClick:()=>O("remote"),className:"flex-1",children:[(0,A.jsx)(j.A,{className:"h-4 w-4 mr-2"}),"Remote/Video"]})]})]}),(0,A.jsxs)("div",{className:"p-6 space-y-8",style:{textAlign:"left"},children:["home_service"===H&&(0,A.jsx)("div",{className:"space-y-6",children:(0,A.jsxs)("div",{children:[(0,A.jsxs)("h3",{className:"font-semibold text-lg mb-4 flex items-center gap-2",children:[(0,A.jsx)(u.A,{className:"h-5 w-5 text-blue-600"}),"Home Visit Monitoring"]}),(0,A.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Consecutive Visits Warning"}),(0,A.jsx)("input",{type:"number",value:h.consecutiveVisitsWarningThreshold,onChange:e=>g({...h,consecutiveVisitsWarningThreshold:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Visits without contract before warning"})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Total Visits for Check"}),(0,A.jsx)("input",{type:"number",value:h.totalVisitsForConversionCheck,onChange:e=>g({...h,totalVisitsForConversionCheck:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Visits before checking conversion rate"})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Minimum Contracts Required"}),(0,A.jsx)("input",{type:"number",value:h.minimumContractsRequired,onChange:e=>g({...h,minimumContractsRequired:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Minimum contracts per period"})]})]})]})}),"remote"===H&&(0,A.jsx)("div",{className:"space-y-6",children:(0,A.jsxs)("div",{children:[(0,A.jsxs)("h3",{className:"font-semibold text-lg mb-4 flex items-center gap-2",children:[(0,A.jsx)(j.A,{className:"h-5 w-5 text-blue-600"}),"Video Call Monitoring"]}),(0,A.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Consecutive Calls Warning"}),(0,A.jsx)("input",{type:"number",value:h.consecutiveVideoCallsWarningThreshold,onChange:e=>g({...h,consecutiveVideoCallsWarningThreshold:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Video calls without contract before warning"})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Total Calls for Check"}),(0,A.jsx)("input",{type:"number",value:h.totalVideoCallsForConversionCheck,onChange:e=>g({...h,totalVideoCallsForConversionCheck:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Video calls before checking conversion"})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Min Conversion Rate (%)"}),(0,A.jsx)("input",{type:"number",value:h.minimumConversionRatePercent,onChange:e=>g({...h,minimumConversionRatePercent:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"0",max:"100"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Minimum conversion rate percentage"})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Min Completion Rate (%)"}),(0,A.jsx)("input",{type:"number",value:h.minimumCompletionRatePercent,onChange:e=>g({...h,minimumCompletionRatePercent:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"0",max:"100"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Minimum job completion rate"})]})]})]})}),(0,A.jsxs)("div",{children:[(0,A.jsxs)("h3",{className:"font-semibold text-lg mb-4 flex items-center gap-2",children:[(0,A.jsx)(n.A,{className:"h-5 w-5 text-red-600"}),"Violation Thresholds"]}),(0,A.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,A.jsxs)("div",{className:"p-4 bg-yellow-50 rounded-lg",children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Reports for First Warning"}),(0,A.jsx)("input",{type:"number",value:h.reportsForFirstWarning,onChange:e=>g({...h,reportsForFirstWarning:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"})]}),(0,A.jsxs)("div",{className:"p-4 bg-orange-50 rounded-lg",children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Reports for Suspension"}),(0,A.jsx)("input",{type:"number",value:h.reportsForSuspension,onChange:e=>g({...h,reportsForSuspension:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"})]}),(0,A.jsxs)("div",{className:"p-4 bg-red-50 rounded-lg",children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Reports for Permanent Ban"}),(0,A.jsx)("input",{type:"number",value:h.reportsForPermanentBan,onChange:e=>g({...h,reportsForPermanentBan:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"})]})]}),(0,A.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mt-4",children:[(0,A.jsxs)("div",{className:"p-4 bg-yellow-50 rounded-lg",children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Contact Sharing: Warning"}),(0,A.jsx)("input",{type:"number",value:h.contactSharingForFirstWarning,onChange:e=>g({...h,contactSharingForFirstWarning:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"})]}),(0,A.jsxs)("div",{className:"p-4 bg-orange-50 rounded-lg",children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Contact Sharing: Suspension"}),(0,A.jsx)("input",{type:"number",value:h.contactSharingForSuspension,onChange:e=>g({...h,contactSharingForSuspension:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"})]}),(0,A.jsxs)("div",{className:"p-4 bg-red-50 rounded-lg",children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Contact Sharing: Ban"}),(0,A.jsx)("input",{type:"number",value:h.contactSharingForBan,onChange:e=>g({...h,contactSharingForBan:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"})]})]})]}),(0,A.jsxs)("div",{children:[(0,A.jsxs)("h3",{className:"font-semibold text-lg mb-4 flex items-center gap-2",children:[(0,A.jsx)(n.A,{className:"h-5 w-5 text-purple-600"}),"Refund Request Monitoring"]}),(0,A.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:(0,A.jsxs)("div",{className:"p-4 bg-purple-50 rounded-lg",children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Consecutive Refunds for Suspension"}),(0,A.jsx)("input",{type:"number",value:h.consecutiveRefundRequestsForSuspension||3,onChange:e=>g({...h,consecutiveRefundRequestsForSuspension:parseInt(e.target.value)||3}),className:"w-full px-3 py-2 border rounded-lg",min:"1"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Consecutive refund requests before 7-day suspension"})]})})]}),(0,A.jsxs)("div",{children:[(0,A.jsxs)("h3",{className:"font-semibold text-lg mb-4 flex items-center gap-2",children:[(0,A.jsx)(d.A,{className:"h-5 w-5 text-orange-600"}),"Suspension Durations"]}),(0,A.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"First Suspension (days)"}),(0,A.jsx)("input",{type:"number",value:h.firstSuspensionDays,onChange:e=>g({...h,firstSuspensionDays:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Second Suspension (days)"}),(0,A.jsx)("input",{type:"number",value:h.secondSuspensionDays,onChange:e=>g({...h,secondSuspensionDays:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"})]})]})]}),(0,A.jsxs)("div",{children:[(0,A.jsxs)("h3",{className:"font-semibold text-lg mb-4 flex items-center gap-2",children:[(0,A.jsx)(c.A,{className:"h-5 w-5 text-green-600"}),"Trust Score & Points"]}),(0,A.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Points per Warning"}),(0,A.jsx)("input",{type:"number",value:h.pointsDeductedPerWarning,onChange:e=>g({...h,pointsDeductedPerWarning:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Negative value for deduction"})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Trust Bonus Points"}),(0,A.jsx)("input",{type:"number",value:h.trustBonusPoints,onChange:e=>g({...h,trustBonusPoints:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"0"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Bonus for compliant behavior"})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Compliant Months for Bonus"}),(0,A.jsx)("input",{type:"number",value:h.compliantMonthsForBonus,onChange:e=>g({...h,compliantMonthsForBonus:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Months before bonus award"})]})]})]}),(0,A.jsxs)("div",{children:[(0,A.jsxs)("h3",{className:"font-semibold text-lg mb-4 flex items-center gap-2",children:[(0,A.jsx)(x.A,{className:"h-5 w-5 text-gray-600"}),"System Settings"]}),(0,A.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Warning Repeat Days"}),(0,A.jsx)("input",{type:"number",value:h.warningRepeatDays,onChange:e=>g({...h,warningRepeatDays:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Days before showing same warning again"})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Monthly Reset Days"}),(0,A.jsx)("input",{type:"number",value:h.monthlyResetDays,onChange:e=>g({...h,monthlyResetDays:parseInt(e.target.value)||0}),className:"w-full px-3 py-2 border rounded-lg",min:"1"}),(0,A.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Days before monthly counter reset"})]})]})]}),(0,A.jsxs)("div",{className:"pt-4 border-t flex justify-end gap-3",children:[(0,A.jsx)(b.$,{variant:"outline",onClick:t,children:"Cancel"}),(0,A.jsxs)(b.$,{onClick:async()=>{try{await T((0,C.GG)({configKey:H,data:h}
1)).unwrap(),await T((0,C.xl)()),t()}catch(e){}},children:[(0,A.jsx)(m.A,{className:"h-4 w-4 mr-2"}),"Save Configuration"]})]})]})]})})};return(0,A.jsxs)("div",{className:"min-h-screen bg-gray-50",style:{textAlign:"left"},children:[(0,A.jsx)(w.A,{}),(0,A.jsx)("main",{className:"lg:pl-64 pt-16",children:(0,A.jsx)("div",{className:"p-6",children:(0,A.jsxs)("div",{className:"max-w-7xl mx-auto space-y-6",children:[(0,A.jsx)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:(0,A.jsxs)("div",{children:[(0,A.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:"Professional Monitoring Settings"}),(0,A.jsx)("p",{className:"text-gray-600 mt-1",children:"Configure automated monitoring rules and thresholds"})]})}),(0,A.jsxs)(N.Zp,{className:"p-6",children:[(0,A.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"System Overview"}),(0,A.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[(0,A.jsxs)("div",{className:"space-y-2",children:[(0,A.jsx)("div",{className:"text-sm text-gray-500",children:"Total Professionals"}),(0,A.jsx)("div",{className:"text-2xl font-semibold",children:X.totalProfessionals}),(0,A.jsx)("div",{className:"text-sm text-gray-600",children:"Being monitored"})]}),(0,A.jsxs)("div",{className:"space-y-2",children:[(0,A.jsx)("div",{className:"text-sm text-gray-500",children:"Active"}),(0,A.jsx)("div",{className:"text-2xl font-semibold text-green-600",children:X.activeProfessionals}),(0,A.jsx)("div",{className:"text-sm text-gray-600",children:"In good standing"})]}),(0,A.jsxs)("div",{className:"space-y-2",children:[(0,A.jsx)("div",{className:"text-sm text-gray-500",children:"Suspended"}),(0,A.jsx)("div",{className:"text-2xl font-semibold text-red-600",children:X.suspendedProfessionals}),(0,A.jsx)("div",{className:"text-sm text-gray-600",children:"Temporarily restricted"})]}),(0,A.jsxs)("div",{className:"space-y-2",children:[(0,A.jsx)("div",{className:"text-sm text-gray-500",children:"Elite Tier"}),(0,A.jsx)("div",{className:"text-2xl font-semibold text-yellow-600",children:X.eliteProfessionals}),(0,A.jsx)("div",{className:"text-sm text-gray-600",children:"Top performers"})]})]})]}),(0,A.jsxs)(N.Zp,{className:"p-6",children:[(0,A.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Performance Tiers"}),(0,A.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"Tiers are automatically calculated based on trust scores. Professionals earn points by completing contracts, maintaining compliance, and providing quality service."}),(0,A.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[{name:"Basic",score:"0-399",color:"gray",description:"Starting tier for new professionals"},{name:"Standard",score:"400-599",color:"blue",description:"Good performance and compliance"},{name:"Advanced",score:"600-799",color:"green",description:"Excellent performance record"},{name:"Elite",score:"800+",color:"yellow",description:"Top-tier professionals with outstanding records"}].map((e,s)=>{var t;const a=(null===F||void 0===F||null===(t=F.filter(s=>s.performanceTier===e.name))||void 0===t?void 0:t.length)||0;return(0,A.jsxs)("div",{className:`p-4 rounded-lg border ${l=e.color,{yellow:"bg-yellow-50 border-yellow-200 text-yellow-600",green:"bg-green-50 border-green-200 text-green-600",blue:"bg-blue-50 border-blue-200 text-blue-600",gray:"bg-gray-50 border-gray-200 text-gray-600"}[l]||"bg-gray-50 border-gray-200 text-gray-600"}`,children:[(0,A.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(e=>{switch(e){case"Elite":default:return(0,A.jsx)(c.A,{className:"h-5 w-5"});case"Advanced":return(0,A.jsx)(h.A,{className:"h-5 w-5"});case"Standard":return(0,A.jsx)(r.A,{className:"h-5 w-5"});case"Basic":return(0,A.jsx)(g.A,{className:"h-5 w-5"})}})(e.name),(0,A.jsx)("h3",{className:"font-medium",children:e.name})]}),(0,A.jsxs)("p",{className:"text-sm mb-1",children:["Score: ",e.score]}),(0,A.jsx)("p",{className:"text-xs opacity-75",children:e.description}),(0,A.jsx)("div",{className:"mt-3 pt-3 border-t border-current/20",children:(0,A.jsxs)("p",{className:"text-xs",children:[(0,A.jsx)("strong",{children:a})," professional",1!==a?"s":""]})})]},s);var l})})]}),(0,A.jsxs)(N.Zp,{className:"p-6",children:[(0,A.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("h2",{className:"text-lg font-semibold",children:"Automated Monitoring System"}),(0,A.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:"Configure thresholds and rules for home service and remote professionals"})]}),(0,A.jsxs)(b.$,{variant:"outline",onClick:()=>W(!0),children:[(0,A.jsx)(x.A,{className:"h-4 w-4 mr-2"}),"Configure Rules"]})]}),(0,A.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,A.jsxs)("div",{className:"p-4 bg-blue-50 rounded-lg border border-blue-200",children:[(0,A.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,A.jsx)(u.A,{className:"h-5 w-5 text-blue-600"}),(0,A.jsx)("h3",{className:"font-medium",children:"Home Service Professionals"})]}),(0,A.jsxs)("div",{className:"space-y-2 text-sm text-gray-700",children:[(0,A.jsxs)("div",{className:"flex items-center gap-2",children:[(0,A.jsx)(r.A,{className:"h-4 w-4 text-blue-600"}),(0,A.jsx)("span",{children:"Tracks home visits and contracts"})]}),(0,A.jsxs)("div",{className:"flex items-center gap-2",children:[(0,A.jsx)(r.A,{className:"h-4 w-4 text-blue-600"}),(0,A.jsx)("span",{children:"Monitors conversion rates"})]}),(0,A.jsxs)("div",{className:"flex items-center gap-2",children:[(0,A.jsx)(r.A,{className:"h-4 w-4 text-blue-600"}),(0,A.jsx)("span",{children:"Revenue threshold checks"})]}),(0,A.jsxs)("div",{className:"flex items-center gap-2",children:[(0,A.jsx)(r.A,{className:"h-4 w-4 text-blue-600"}),(0,A.jsx)("span",{children:"Automatic warnings and suspensions"})]})]}),M.find(e=>
1"home_service"===e.configKey)&&(0,A.jsx)("div",{className:"mt-4 pt-3 border-t border-blue-200",children:(0,A.jsxs)("p",{className:"text-xs text-blue-700",children:[(0,A.jsx)("strong",{children:"Warning Threshold:"})," ",null===(k=M.find(e=>"home_service"===e.configKey))||void 0===k?void 0:k.consecutiveVisitsWarningThreshold," consecutive visits"]})})]}),(0,A.jsxs)("div",{className:"p-4 bg-purple-50 rounded-lg border border-purple-200",children:[(0,A.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,A.jsx)(j.A,{className:"h-5 w-5 text-purple-600"}),(0,A.jsx)("h3",{className:"font-medium",children:"Remote/Video Professionals"})]}),(0,A.jsxs)("div",{className:"space-y-2 text-sm text-gray-700",children:[(0,A.jsxs)("div",{className:"flex items-center gap-2",children:[(0,A.jsx)(r.A,{className:"h-4 w-4 text-purple-600"}),(0,A.jsx)("span",{children:"Tracks video calls and contracts"})]}),(0,A.jsxs)("div",{className:"flex items-center gap-2",children:[(0,A.jsx)(r.A,{className:"h-4 w-4 text-purple-600"}),(0,A.jsx)("span",{children:"Monitors conversion rates"})]}),(0,A.jsxs)("div",{className:"flex items-center gap-2",children:[(0,A.jsx)(r.A,{className:"h-4 w-4 text-purple-600"}),(0,A.jsx)("span",{children:"Contact sharing detection"})]}),(0,A.jsxs)("div",{className:"flex items-center gap-2",children:[(0,A.jsx)(r.A,{className:"h-4 w-4 text-purple-600"}),(0,A.jsx)("span",{children:"Job completion tracking"})]})]}),M.find(e=>"remote"===e.configKey)&&(0,A.jsx)("div",{className:"mt-4 pt-3 border-t border-purple-200",children:(0,A.jsxs)("p",{className:"text-xs text-purple-700",children:[(0,A.jsx)("strong",{children:"Warning Threshold:"})," ",null===(P=M.find(e=>"remote"===e.configKey))||void 0===P?void 0:P.consecutiveVideoCallsWarningThreshold," consecutive calls"]})})]})]}),(0,A.jsxs)("div",{className:"mt-4 grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,A.jsxs)("div",{className:"p-4 bg-gray-50 rounded-lg",children:[(0,A.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,A.jsxs)("div",{className:"flex items-center gap-2",children:[(0,A.jsx)(f.A,{className:"h-5 w-5 text-orange-600"}),(0,A.jsx)("h4",{className:"font-medium",children:"Automated Checks"})]}),(0,A.jsx)(y.E,{variant:void 0,className:"bg-green-100 text-green-700",children:"Active"})]}),(0,A.jsx)("p",{className:"text-sm text-gray-600",children:"Daily suspension checks, monthly resets, real-time violation detection"})]}),(0,A.jsxs)("div",{className:"p-4 bg-gray-50 rounded-lg",children:[(0,A.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,A.jsxs)("div",{className:"flex items-center gap-2",children:[(0,A.jsx)(p.A,{className:"h-5 w-5 text-blue-600"}),(0,A.jsx)("h4",{className:"font-medium",children:"Trust Score System"})]}),(0,A.jsxs)(y.E,{variant:void 0,className:"bg-blue-100 text-blue-700",children:["Avg: ",X.averageTrustScore]})]}),(0,A.jsx)("p",{className:"text-sm text-gray-600",children:"+5 per completed contract, -25 per warning, +20 after 3 compliant months"})]}),(0,A.jsxs)("div",{className:"p-4 bg-gray-50 rounded-lg",children:[(0,A.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,A.jsxs)("div",{className:"flex items-center gap-2",children:[(0,A.jsx)(o.A,{className:"h-5 w-5 text-gray-600"}),(0,A.jsx)("h4",{className:"font-medium",children:"Current Status"})]})}),(0,A.jsxs)("p",{className:"text-sm text-gray-600",children:[X.activeProfessionals," active, ",X.suspendedProfessionals," suspended, ",X.eliteProfessionals," elite"]})]})]})]}),(0,A.jsxs)(N.Zp,{className:"p-6",children:[(0,A.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Quick Actions"}),(0,A.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[(0,A.jsx)(b.$,{variant:"outline",onClick:()=>window.location.href="/admin/scoring/monitoring",className:"h-auto py-4 justify-start",children:(0,A.jsxs)("div",{className:"flex items-start gap-3 text-left",children:[(0,A.jsx)(h.A,{className:"h-5 w-5 text-blue-600 mt-0.5"}),(0,A.jsxs)("div",{children:[(0,A.jsx)("h3",{className:"font-medium mb-1",children:"View Monitoring Dashboard"}),(0,A.jsx)("p",{className:"text-sm text-gray-600",children:"See all professionals' monitoring data and client reports"})]})]})}),(0,A.jsx)(b.$,{variant:"outline",onClick:()=>W(!0),className:"h-auto py-4 justify-start",children:(0,A.jsxs)("div",{className:"flex items-start gap-3 text-left",children:[(0,A.jsx)(x.A,{className:"h-5 w-5 text-purple-600 mt-0.5"}),(0,A.jsxs)("div",{children:[(0,A.jsx)("h3",{className:"font-medium mb-1",children:"Configure Monitoring"}),(0,A.jsx)("p",{className:"text-sm text-gray-600",children:"Adjust warning levels, suspension rules, and point values"})]})]})}),(0,A.jsx)(b.$,{variant:"outline",onClick:()=>J(!0),className:"h-auto py-4 justify-start",children:(0,A.jsxs)("div",{className:"flex items-start gap-3 text-left",children:[(0,A.jsx)(c.A,{className:"h-5 w-5 text-yellow-600 mt-0.5"}),(0,A.jsxs)("div",{children:[(0,A.jsx)("h3",{className:"font-medium mb-1",children:"Configure Achievements"}),(0,A.jsx)("p",{className:"text-sm text-gray-600",children:"Set thresholds for professional and client achievements"})]})]})})]})]})]})})}),(0,A.jsx)(ee,{isOpen:B,onClose:()=>W(!1)}),(0,A.jsx)(R,{isOpen:q,onClose:()=>J(!1),achievementConfigs:E,selectedAchievementType:Q,setSelectedAchievementType:U,dispatch:T})]})};t.d(s,["default",0,k])}}]);
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.