/opt/canhelp/apps/web/.next/cache/webpack/client-production
Edit: /opt/canhelp/apps/web/.next/cache/webpack/client-production/10.pack (1092709B)
wpc Y webpack/lib/cache/PackFileCacheStrategyPackContentItems`MinifierWebpackPlugin|static/chunks/app/layout-71cf4d8416ad2f8a.jsMinifierWebpackPlugin|static/chunks/app/chat/page-46e3ac95f29611c7.jsMinifierWebpackPlugin|static/chunks/app/dashboard/page-59a57f945179cdf1.jsMinifierWebpackPlugin|static/chunks/app/admin/page-06060ac92bdd22f1.jsMinifierWebpackPlugin|static/chunks/app/notifications/page-0ad48fa366b410fc.jsMinifierWebpackPlugin|static/chunks/app/pricing/page-0151bc212317c2c1.jsMinifierWebpackPlugin|static/chunks/app/tasks/[id]/offer/page-000ae49be3414ced.jsMinifierWebpackPlugin|static/chunks/app/tasks/[id]/page-11e4e0237ceb6c9f.jsMinifierWebpackPlugin|static/chunks/app/users/[id]/page-0d518b8326e5ca8e.jsMinifierWebpackPlugin|static/chunks/app/profile/page-85bc775c497c0e54.jsMinifierWebpackPlugin|static/chunks/app/site/[slug]/page-712e602d54abb4c9.jsMinifierWebpackPlugin|static/chunks/9906-8062bce0bce91a41.jsMinifierWebpackPlugin|static/ZbsZh6Gs9NulTvXE1lVxp/_ssgManifest.jsMinifierWebpackPlugin|static/ZbsZh6Gs9NulTvXE1lVxp/_buildManifest.jsCssMinimizerPlugin|static/css/06c8fb6d250a09ce.cssRealContentHashPlugin|analyse|static/chunks/app/layout-71cf4d8416ad2f8a.jsRealContentHashPlugin|analyse|static/chunks/app/chat/page-46e3ac95f29611c7.jsRealContentHashPlugin|analyse|static/chunks/app/dashboard/page-59a57f945179cdf1.jsRealContentHashPlugin|analyse|static/chunks/app/admin/page-06060ac92bdd22f1.jsRealContentHashPlugin|analyse|static/chunks/app/notifications/page-0ad48fa366b410fc.jsRealContentHashPlugin|analyse|static/chunks/app/pricing/page-0151bc212317c2c1.jsRealContentHashPlugin|analyse|static/chunks/app/tasks/[id]/offer/page-000ae49be3414ced.jsRealContentHashPlugin|analyse|static/chunks/app/tasks/[id]/page-11e4e0237ceb6c9f.jsRealContentHashPlugin|analyse|static/chunks/app/users/[id]/page-0d518b8326e5ca8e.jsRealContentHashPlugin|analyse|static/chunks/app/profile/page-85bc775c497c0e54.jsRealContentHashPlugin|analyse|static/chunks/app/site/[slug]/page-712e602d54abb4c9.jsRealContentHashPlugin|analyse|static/css/06c8fb6d250a09ce.cssRealContentHashPlugin|analyse|static/chunks/9906-8062bce0bce91a41.jsRealContentHashPlugin|analyse|static/ZbsZh6Gs9NulTvXE1lVxp/_ssgManifest.jsRealContentHashPlugin|analyse|static/ZbsZh6Gs9NulTvXE1lVxp/_buildManifest.jsRealContentHashPlugin|generate|static/ZbsZh6Gs9NulTvXE1lVxp/_buildManifest.jssourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceF (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{300:(e,t,r)=>{"use strict";r.d(t,{AdminRolePreview:()=>d});var n=r(4568),s=r(1592),a=r(7541),l=r(7620),o=r(2982);let i="canhelp_admin_orig_plan",c={free:"bg-slate-100 text-slate-600",pro:"bg-green-100 text-green-700",ultimate:"bg-amber-100 text-amber-700"};function d(){var e,t;let{data:r}=(0,s.wV)(),d=(0,a.useRouter)(),h=(null==r||null==(e=r.user)?void 0:e.role)==="admin",u=null==r||null==(t=r.user)?void 0:t.id,[x,m]=(0,l.useState)(!1),[f,p]=(0,l.useState)([]),[g,v]=(0,l.useState)(null),[j,k]=(0,l.useState)(!1),[b,w]=(0,l.useState)(!1),y=(0,l.useRef)(null);if((0,l.useEffect)(()=>m(!0),[]),(0,l.useEffect)(()=>{y.current=localStorage.getItem(i)},[]),(0,l.useEffect)(()=>{h&&(0,o.T9)().then(p).catch(()=>{})},[h]),(0,l.useEffect)(()=>{var e,t;v(null!=(t=null==r||null==(e=r.user)?void 0:e.planId)?t:null)},[r]),!x||!h)return null;let N=async e=>{if(u){k(!0);try{!y.current&&g&&(localStorage.setItem(i,g),y.current=g),await (0,o.wl)(u,{planId:e}),v(e),window.dispatchEvent(new CustomEvent("canhelp:plan-changed",{detail:{planId:e}})),d.refresh()}catch(e){}k(!1)}},C=async()=>{let e=y.current;localStorage.removeItem(i),y.current=null,await N(null!=e?e:null)},L=!!y.current;return(0,n.jsxs)("div",{className:"fixed bottom-20 right-4 z-50 bg-white border border-slate-200 rounded-2xl shadow-lg text-xs font-medium select-none",style:{minWidth:130},children:[(0,n.jsxs)("button",{onClick:()=>w(e=>!e),className:"flex items-center justify-between gap-2 w-full px-3 py-2 text-slate-500 hover:text-slate-700 transition rounded-2xl",children:[(0,n.jsx)("span",{children:"\uD83D\uDC41 Preview"}),(0,n.jsx)("span",{className:"text-slate-300",children:b?"▲":"▼"})]}),b&&(0,n.jsx)("div",{className:"flex flex-col gap-1 px-2 pb-2 border-t border-slate-100 pt-2",children:f.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"text-slate-400 px-1 mt-2 mb-0.5",children:"Plan"}),f.map(e=>{var t;return(0,n.jsxs)("button",{disabled:j,onClick:()=>N(e.id===g?null:e.id),className:"flex items-center justify-between gap-2 px-3 py-1.5 rounded-xl transition text-left ".concat(g===e.id?"bg-indigo-600 text-white":"text-slate-600 hover:bg-slate-100"," ").concat(j?"opacity-50":""),children:[(0,n.jsx)("span",{className:"truncate max-w-[90px]",children:e.name}),(0,n.jsx)("span",{className:"px-1.5 py-0.5 rounded-full text-[10px] font-semibold ".concat(g===e.id?"bg-white/20 text-white":null!=(t=c[e.tier])?t:c.free),children:e.tier})]},e.id)}),g&&(0,n.jsx)("button",{disabled:j,onClick:()=>N(null),className:"px-3 py-1 rounded-xl text-slate-400 hover:text-red-500 hover:bg-red-50 transition text-left",children:"✕ No plan"}),L&&(0,n.jsx)("button",{disabled:j,onClick:C,className:"px-3 py-1 rounded-xl text-green-600 hover:bg-green-50 transition text-left",children:"↩ Restore"})]})})]})}},1258:(e,t,r)=>{"use strict";function n(e){if(!(null==e?void 0:e.trim()))return"—";let t=e.trim().split(/\s+/);return t.length<2||!t[1]?t[0]:"".concat(t[0]," ").concat(t[1][0].toUpperCase(),".")}function s(e,t,r){if(null==e?void 0:e.trim()){let r=null==t?void 0:t.trim();return r?"".concat(e.trim()," ").concat(r[0].toUpperCase(),"."):e.trim()}return n(r)}r.d(t,{E:()=>n,H:()=>s})},1592:(e,t,r)=>{"use strict";r.d(t,{CI:()=>a,Hh:()=>l,Jv:()=>s,wV:()=>o,yK:()=>n});let n=(0,r(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:s,signOut:a,signUp:l,useSession:o}=n},2568:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,8761,23)),Promise.resolve().then(r.bind(r,300)),Promise.resolve().then(r.bind(r,9808)),Promise.resolve().then(r.bind(r,9649)),Promise.resolve().then(r.bind(r,7380)),Promise.resolve().then(r.bind(r,9906)),Promise.resolve().then(r.bind(r,4029))},3042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return n.workAsyncStorageInstance}});let n=r(6035)},3625:(e,t,r)=>{"use strict";function n(e){let{moduleIds:t}=e;return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return n}}),r(4568),r(7509),r(3042),r(1271)},4029:(e,t,r)=>{"use strict";r.d(t,{LocationProvider:()=>o,z:()=>i});var n=r(4568),s=r(7620),a=r(2982);let l=(0,s.createContext)({locationSlug:"",locationTree:[],locationLoading:!0,setLocation:()=>{},getLabel:()=>""});function o(e){let{children:t,initialSlug:r=""}=e,[o,i]=(0,s.useState)(r),[c,d]=(0,s.useState)([]),[h,u]=(0,s.useState)(!0);(0,s.useEffect)(()=>{i(function(){if("undefined"==typeof document)return"";let e=document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/);return(null==e?void 0:e[1])?decodeURIComponent(e[1]):""}())},[]),(0,s.useEffect)(()=>{(0,a.Vs)().then(e=>d(e)).catch(()=>{}).finally(()=>u(!1))},[]);let x=(0,s.useCallback)(e=>{i(e);let t=encodeURIComponent(e);document.cookie="canhelp_location=".concat(t,"; path=/; max-age=31536000; SameSite=Lax")},[]),m=(0,s.useCallback)(e=>{if(!o)return"";for(let s of c){var t,r,n;if(s.slug===o)return null!=(t=s.names[e])?t:s.names.el;for(let t of null!=(r=s.children)?r:[])if(t.slug===o)return null!=(n=t.names[e])?n:t.names.el}return o},[o,c]);return(0,n.jsx)(l.Provider,{value:{locationSlug:o,locationTree:c,locationLoading:h,setLocation:x,getLabel:m},children:t})}function i(){return(0,s.useContext)(l)}},5575:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let n=r(4931)._(r(7007));function s(e,t){var r;let s={};"function"==typeof e&&(s.loader=e);let a={...s,...t};return(0,n.default)({...a,modules:null==(r=a.loadableGenerated)?void 0:r.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6035:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,r(9113).createAsyncLocalStorage)()},6442:(e,t,r)=>{"use strict";r.d(t,{default:()=>s.a});var n=r(5575),s=r.n(n)},6452:(e,t,r)=>{"use strict";function n(e){let{reason:t,children:r}=e;return r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return n}}),r(9800)},7007:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});let n=r(4568),s=r(7620),a=r(6452);function l(e){return{default:e&&"default"in e?e.default:e}}r(3625);let o={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},i=function(e){let t={...o,...e},r=(0,s.lazy)(()=>t.loader().then(l)),i=t.loading;function c(e){let l=i?(0,n.jsx)(i,{isLoading:!0,pastDelay:!0,error:null}):null,o=!t.ssr||!!t.loading,c=o?s.Suspense:s.Fragment,d=t.ssr?(0,n.jsxs)(n.Fragment,{children:[null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(a.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(c,{...o?{fallback:l}:{},children:d})}return c.displayName="LoadableComponent",c}},7380:(e,t,r)=>{"use strict";r.d(t,{ScrollToTopButton:()=>a});var n=r(4568),s=r(7620);function a(){let[e,t]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let e=()=>{t(window.scrollY>200)};return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[]),(0,n.jsx)("button",{className:"scroll-to-top-btn".concat(e?" visible":""),"aria-label":"Наверх",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),children:(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M10 16V4M10 4L4 10M10 4L16 10",stroke:"white",strokeWidth:"2.8",strokeLinecap:"round",strokeLinejoin:"round"})})})}},8761:()=>{},9113:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{bindSnapshot:function(){return l},createAsyncLocalStorage:function(){return a},createSnapshot:function(){return o}});let r=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class n{disable(){throw r}getStore(){}run(){throw r}exit(){throw r}enterWith(){throw r}static bind(e){return e}}let s="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function a(){return s?new s:new n}function l(e){return s?s.bind(e):n.bind(e)}function o(){return s?s.snapshot():function(e,...t){return e(...t)}}},9649:(e,t,r)=>{"use strict";r.d(t,{Header:()=>g});var n=r(4568),s=r(9664),a=r.n(s),l=r(7541),o=r(1592),i=r(9906),c=r(1258),d=r(7620),h=r(4962);function u(){var e;let{locale:t,setLocale:r}=(0,i.Y)(),[s,a]=(0,d.useState)(!1),l=(0,d.useRef)(null),o=null!=(e=h.YZ.find(e=>e.code===t))?e:h.YZ[0];return(0,d.useEffect)(()=>{function e(e){l.current&&!l.current.contains(e.target)&&a(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,n.jsxs)("div",{ref:l,className:"relative",children:[(0,n.jsxs)("button",{onClick:()=>a(!s),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700","aria-label":"Change language",children:[(0,n.jsx)("span",{children:o.code.toUpperCase()}),(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-gray-400 transition-transform ".concat(s?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),s&&(0,n.jsx)("div",{className:"absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden",children:h.YZ.map(e=>(0,n.jsxs)("button",{onClick:()=>{r(e.code),a(!1)},className:"w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ".concat(t===e.code?"bg-green-50 text-green-700 font-medium":"text-gray-700"),children:[(0,n.jsx)("span",{children:e.label}),t===e.code&&(0,n.jsx)("svg",{className:"w-3.5 h-3.5 ml-auto text-green-600",fill:"currentColor",viewBox:"0 0 20 20",children:(0,n.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})]},e.code))})]})}var x=r(2982),m=r(2838);function f(){var e;if("undefined"==typeof document)return null;let t=document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/);return null!=(e=null==t?void 0:t[1])?e:null}let p=(0,r(6442).default)(()=>r.e(6467).then(r.bind(r,6467)),{loadableGenerated:{webpack:()=>[6467]},ssr:!1});function g(){var e;(0,l.useRouter)();let t=(0,l.usePathname)(),{data:r}=(0,o.wV)(),{t:s,locale:h}=(0,i.Y)(),[g,v]=(0,d.useState)(!1),[j,k]=(0,d.useState)(!1),[b,w]=(0,d.useState)(!1),[y,N]=(0,d.useState)(0),[C,L]=(0,d.useState)(0),[M,_]=(0,d.useState)(null),[z,E]=(0,d.useState)(null),S=(0,d.useRef)(null),B=(0,d.useRef)(null),W=(0,d.useRef)(null),P=(0,d.useRef)(t);(0,d.useEffect)(()=>{P.current=t},[t]),(0,d.useEffect)(()=>{function e(e){S.current&&!S.current.contains(e.target)&&k(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let H=(null==r||null==(e=r.user)?void 0:e.role)==="admin",V="specialist"===function(){var e;let{data:t}=(0,o.wV)(),r=null==t||null==(e=t.user)?void 0:e.role,n="admin"===r,[s,a]=(0,d.useState)(null);return((0,d.useEffect)(()=>{if(!n)return;a(f());let e=()=>a(f());return window.addEventListener("canhelp:preview-role",e),document.addEventListener("visibilitychange",e),()=>{window.removeEventListener("canhelp:preview-role",e),document.removeEventListener("visibilitychange",e)}},[n]),r)?n&&s?s:r:null}(),O=function(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r?t===e:t===e||t.startsWith(e+"/")},A=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"font-medium text-sm transition ".concat(O(e,t)?"text-green-600":"text-gray-600 hover:text-green-600")},R=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"flex items-center gap-2 font-medium py-1 ".concat(O(e,t)?"text-green-600":"text-gray-700")};return(0,d.useEffect)(()=>{"/chat"===t&&L(0)},[t]),(0,d.useEffect)(()=>{if(!r)return;let e=(0,m.io)("https://api.canhelp.gr",{withCredentials:!0,transports:["websocket","polling"]});return e.on("new_message",e=>{"/chat"!==P.current&&(L(e=>e+1),W.current&&clearTimeout(W.current),_(e),W.current=setTimeout(()=>_(null),5e3))}),()=>{e.disconnect(),W.current&&clearTimeout(W.current)}},[r]),(0,d.useEffect)(()=>{if(!r)return void N(0);let e=()=>(0,x.$M)().then(e=>N(e.count)).catch(()=>{});e();let t=setInterval(e,3e4);return()=>clearInterval(t)},[r]),(0,d.useEffect)(()=>{if(!r)return void E(null);(0,x.H)().then(e=>{var t,r;return E(null!=(r=null==(t=e.plan)?void 0:t.tier)?r:null)}).catch(()=>{})},[r]),(0,d.useEffect)(()=>{let e=()=>{B.current&&(window.scrollY>40?B.current.classList.add("header-shrink"):B.current.classList.remove("header-shrink"))};return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("header",{ref:B,className:"header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300",children:(0,n.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between h-16 header-content transition-all duration-300",children:[(0,n.jsxs)(a(),{href:"/",className:"flex items-center gap-2 shrink-0",children:[(0,n.jsx)("img",{src:"/logo.png",alt:"CanHelp",className:"w-8 h-8 object-contain"}),(0,n.jsx)("span",{className:"logo-text text-2xl font-bold text-green-600 transition-all duration-300",children:"CanHelp"})]}),(0,n.jsxs)("nav",{className:"hidden md:flex items-center gap-5 ml-auto",children:[V?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a(),{href:"/tasks",className:A("/tasks"),children:s("nav.find_tasks")}),(0,n.jsx)(a(),{href:"/dashboard",className:A("/dashboard"),children:s("nav.dashboard")})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a(),{href:"/tasks/new",className:A("/tasks/new",!0),children:s("dashboard.new_task")})," ",(0,n.jsx)(a(),{href:"/tasks",className:A("/tasks"),children:s("nav.tasks")})," ",(0,n.jsx)(a(),{href:"/specialists",className:A("/specialists"),children:s("nav.specialists")})]}),(0,n.jsx)(a(),{href:"/pricing",className:A("/pricing",!0),children:s("nav.pricing","Pricing")}),r?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/notifications",className:"relative text-gray-600 hover:text-gray-900 flex items-center",children:[(0,n.jsx)("svg",{className:"w-5 h-5 ".concat(y>0?"text-green-600":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"})}),y>0&&(0,n.jsx)("span",{className:"absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none",children:y>99?"99+":y})]}),(0,n.jsxs)(a(),{href:"/chat",className:"relative text-gray-600 hover:text-gray-900 flex items-center",children:[(0,n.jsx)("svg",{className:"w-5 h-5 ".concat(C>0?"text-green-500":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),C>0&&(0,n.jsx)("span",{className:"absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none",children:C>99?"99+":C})]}),(0,n.jsxs)("div",{className:"relative",ref:S,children:[(0,n.jsxs)("button",{onClick:()=>k(!j),className:"flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600",children:[(0,n.jsx)("span",{className:"truncate max-w-[100px]",children:(0,c.H)(r.user.firstName,r.user.lastName,r.user.name)}),"pro"===z&&(0,n.jsx)("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none",children:"Pro"}),"ultimate"===z&&(0,n.jsx)("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none",children:"★"}),(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),j&&(0,n.jsxs)("div",{className:"absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50",children:[V?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/tasks/new",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),s("nav.new_task")]}),(0,n.jsxs)(a(),{href:"/specialists",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})}),s("nav.specialists")]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/notifications",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0 ".concat(y>0?"text-green-600":"text-gray-400"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"})}),(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[s("nav.notifications"),y>0&&(0,n.jsx)("span",{className:"px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none",children:y>99?"99+":y})]})]}),(0,n.jsxs)(a(),{href:"/chat",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0 ".concat(C>0?"text-green-500":"text-gray-400"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[s("nav.chat"),C>0&&(0,n.jsx)("span",{className:"px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none",children:C>99?"99+":C})]})]}),(0,n.jsxs)(a(),{href:"/dashboard",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"})}),s("nav.dashboard")]})]}),(V||H)&&(0,n.jsxs)(a(),{href:"/schedule",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),s("nav.schedule")]}),H&&(0,n.jsxs)(a(),{href:"/admin",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsxs)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:[(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),s("nav.admin")]}),(0,n.jsxs)(a(),{href:"/profile",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),s("nav.profile")]}),(0,n.jsxs)(a(),{href:"/favorites",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"})}),s("nav.favorites")]}),(0,n.jsx)("hr",{className:"my-1 border-gray-100"}),(0,n.jsxs)("button",{className:"w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50",onClick:()=>{k(!1),w(!0)},children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z"})}),s("support.title")]}),(0,n.jsx)("hr",{className:"my-1 border-gray-100"}),(0,n.jsxs)("button",{className:"w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50",onClick:()=>{k(!1),(0,o.CI)().then(()=>{window.location.href="/"})},children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})}),s("nav.logout")]})]})]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a(),{href:"/login",className:"text-gray-600 hover:text-green-600 font-medium text-sm",children:s("nav.login")}),(0,n.jsx)(a(),{href:"/register",className:"bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm",children:s("nav.register")})]}),(0,n.jsx)(u,{})]}),(0,n.jsxs)("div",{className:"md:hidden flex items-center gap-2",children:[(0,n.jsx)(u,{}),(0,n.jsx)("button",{className:"p-2",onClick:()=>v(!g),"aria-label":"Toggle menu",children:(0,n.jsx)("svg",{className:"w-5 h-5 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:g?(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),g&&(0,n.jsxs)("div",{className:"md:hidden py-4 border-t border-gray-100 flex flex-col gap-3",children:[V?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/tasks",className:R("/tasks"),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),s("nav.find_tasks")]}),(0,n.jsxs)(a(),{href:"/dashboard",className:R("/dashboard"),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"})}),s("nav.dashboard")]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/tasks/new",className:R("/tasks/new",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),s("nav.new_task")]}),(0,n.jsxs)(a(),{href:"/tasks",className:R("/tasks"),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})}),s("nav.tasks")]}),(0,n.jsxs)(a(),{href:"/specialists",className:R("/specialists"),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})}),s("nav.specialists")]})]}),r?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/chat",className:R("/chat",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0 ".concat(C>0?"text-green-500":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),s("nav.chat"),C>0&&(0,n.jsx)("span",{className:"ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full",children:C})]}),V?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/tasks/new",className:R("/tasks/new",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),s("nav.new_task")]}),(0,n.jsxs)(a(),{href:"/specialists",className:R("/specialists"),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})}),s("nav.specialists")]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/notifications",className:R("/notifications",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0 ".concat(y>0?"text-green-600":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"})}),(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[s("nav.notifications"),y>0&&(0,n.jsx)("span",{className:"px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full",children:y>99?"99+":y})]})]}),(0,n.jsxs)(a(),{href:"/dashboard",className:R("/dashboard"),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"})}),s("nav.dashboard")]})]}),(0,n.jsxs)(a(),{href:"/favorites",className:R("/favorites",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"})}),s("nav.favorites")]}),(V||H)&&(0,n.jsxs)(a(),{href:"/schedule",className:R("/schedule",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),s("nav.schedule")]}),H&&(0,n.jsxs)(a(),{href:"/admin",className:R("/admin"),onClick:()=>v(!1),children:[(0,n.jsxs)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:[(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),s("nav.admin")]}),(0,n.jsxs)(a(),{href:"/profile",className:R("/profile",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),s("nav.profile")]}),(0,n.jsxs)("button",{onClick:()=>{v(!1),(0,o.CI)().then(()=>{window.location.href="/"})},className:"flex items-center gap-2 text-left text-red-500 py-1 font-medium",children:[(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})}),s("nav.logout")]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a(),{href:"/login",className:"text-gray-700 font-medium py-1",onClick:()=>v(!1),children:s("nav.login")}),(0,n.jsx)(a(),{href:"/register",className:"text-green-600 font-medium py-1",onClick:()=>v(!1),children:s("nav.register")})]})]})]})}),M&&(0,n.jsx)("div",{className:"fixed bottom-5 right-5 z-[200] max-w-sm w-full",children:(0,n.jsxs)("div",{className:"bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in",children:[(0,n.jsx)("span",{className:"text-2xl shrink-0",children:"\uD83D\uDCAC"}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("p",{className:"font-semibold text-gray-900 text-sm",children:s("chat.toast_title")}),(0,n.jsx)("p",{className:"text-xs text-gray-500 truncate mt-0.5",children:M.body})]}),(0,n.jsxs)("div",{className:"flex flex-col items-end gap-2 shrink-0",children:[(0,n.jsx)("button",{onClick:()=>_(null),className:"text-gray-400 hover:text-gray-600 text-lg leading-none","aria-label":"close",children:"\xd7"}),(0,n.jsx)(a(),{href:"/chat?room=".concat(M.roomId),onClick:()=>_(null),className:"text-xs text-green-600 hover:underline font-medium",children:s("chat.toast_open")})]})]})}),b&&(0,n.jsx)(p,{onClose:()=>w(!1)})]})}},9808:(e,t,r)=>{"use strict";r.d(t,{Footer:()=>d});var n=r(4568),s=r(9906),a=r(7620),l=r(9664),o=r.n(l);let i=[{key:"telegram",label:"Telegram",hoverClass:"hover:text-sky-500",svg:'
'},{key:"instagram",label:"Instagram",hoverClass:"hover:text-pink-500",svg:'
'},{key:"facebook",label:"Facebook",hoverClass:"hover:text-green-600",svg:'
'},{key:"twitter",label:"X",hoverClass:"hover:text-gray-900",svg:'
'},{key:"youtube",label:"YouTube",hoverClass:"hover:text-red-600",svg:'
'},{key:"tiktok",label:"TikTok",hoverClass:"hover:text-black",svg:'
'},{key:"whatsapp",label:"WhatsApp",hoverClass:"hover:text-green-500",svg:'
'},{key:"viber",label:"Viber",hoverClass:"hover:text-purple-600",svg:'
'}];function c(e){let{className:t="",links:r}=e,s=i.filter(e=>{let{key:t}=e;return null==r?void 0:r[t]});return 0===s.length?null:(0,n.jsx)("div",{className:"flex gap-4 flex-wrap ".concat(t),children:s.map(e=>{let{key:t,label:s,hoverClass:a,svg:l}=e;return(0,n.jsx)("a",{href:r[t],target:"_blank",rel:"noopener noreferrer","aria-label":s,className:"text-gray-500 transition ".concat(a),children:(0,n.jsx)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"currentColor",dangerouslySetInnerHTML:{__html:l}})},t)})})}function d(){let{t:e}=(0,s.Y)(),t=new Date().getFullYear(),[r,l]=(0,a.useState)({});return(0,a.useEffect)(()=>{fetch("".concat("https://api.canhelp.gr","/api/admin/social-public")).then(e=>e.ok?e.json():{}).then(e=>{let t={};for(let[r,n]of Object.entries(e))n&&(t[r.replace("social.","")]=n);l(t)}).catch(()=>{})},[]),(0,n.jsx)("footer",{className:"bg-white border-t border-gray-200 mt-16",children:(0,n.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,n.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-start gap-10",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-[200px] flex flex-col items-start",children:[(0,n.jsx)("span",{className:"logo-text text-3xl text-green-700 font-bold mb-2",children:"CanHelp"}),(0,n.jsx)("p",{className:"text-base text-gray-600 mb-4",children:e("footer.slogan")})]}),(0,n.jsxs)("div",{className:"flex-1 min-w-[180px]",children:[(0,n.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-3",children:e("footer.links")}),(0,n.jsxs)("ul",{className:"space-y-2",children:[(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/",className:"hover:text-green-600 transition",children:e("nav.home")})}),(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/tasks",className:"hover:text-green-600 transition",children:e("nav.tasks")})}),(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/specialists",className:"hover:text-green-600 transition",children:e("nav.specialists")})}),(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/pricing",className:"hover:text-green-600 transition",children:e("nav.pricing")})}),(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/support",className:"hover:text-green-600 transition",children:e("support.title")})}),(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/privacy",className:"hover:text-green-600 transition",children:e("nav.privacy")})}),(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/delete-account",className:"hover:text-red-500 transition",children:e("nav.delete_account")})})]})]}),(0,n.jsxs)("div",{className:"flex-1 min-w-[180px]",children:[(0,n.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-3",children:e("footer.socials")}),(0,n.jsx)("p",{className:"text-gray-500 text-sm mb-2",children:"info@canhelp.gr"}),(0,n.jsx)(c,{className:"mt-2",links:r})]})]}),(0,n.jsxs)("div",{className:"mt-10 border-t border-gray-100 pt-6 text-center text-gray-400 text-sm",children:["\xa9 ",t," CanHelp. ",e("footer.rights")]})]})})}}},e=>{e.O(0,[9950,1516,9664,2838,9906,2982,587,18,7358],()=>e(e.s=2568)),_N_E=e.O()}]);;= (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8457],{1258:(e,t,r)=>{"use strict";function l(e){if(!(null==e?void 0:e.trim()))return"—";let t=e.trim().split(/\s+/);return t.length<2||!t[1]?t[0]:"".concat(t[0]," ").concat(t[1][0].toUpperCase(),".")}function s(e,t,r){if(null==e?void 0:e.trim()){let r=null==t?void 0:t.trim();return r?"".concat(e.trim()," ").concat(r[0].toUpperCase(),"."):e.trim()}return l(r)}r.d(t,{E:()=>l,H:()=>s})},1592:(e,t,r)=>{"use strict";r.d(t,{CI:()=>n,Hh:()=>a,Jv:()=>s,wV:()=>i,yK:()=>l});let l=(0,r(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:s,signOut:n,signUp:a,useSession:i}=l},4251:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>g});var l=r(4568),s=r(7620),n=r(7541),a=r(9664),i=r.n(a),o=r(1592),c=r(9906),d=r(2982),u=r(1258),x=r(2838);let m="https://api.canhelp.gr";function h(){var e,t,r,a,h,g,f;let p=(0,n.useRouter)(),v=(0,n.useSearchParams)(),{data:b,isPending:j}=(0,o.wV)(),{t:y,locale:w}=(0,c.Y)(),[N,k]=(0,s.useState)([]),[C,L]=(0,s.useState)(!0),[M,_]=(0,s.useState)(null),[S,U]=(0,s.useState)([]),[E,D]=(0,s.useState)(!1),[T,A]=(0,s.useState)(""),[R,B]=(0,s.useState)(!1),[H,W]=(0,s.useState)(null),[I,z]=(0,s.useState)(!1),[V,P]=(0,s.useState)(null),K=(0,s.useRef)(null),O=(0,s.useRef)(null),F=(0,s.useRef)(null),G=(0,s.useRef)(null);(0,s.useEffect)(()=>{j||b||p.push("/login")},[b,j]),(0,s.useEffect)(()=>{b&&((0,d.Zp)().then(e=>{k(e);let t=v.get("room");t&&_(t)}).catch(e=>console.error("[chat] getChatRooms error:",e)).finally(()=>L(!1)),(0,d.z4)().then(e=>W({left:e.messagesLeft,sent:e.messagesSent})).catch(e=>console.error("[chat] getDailyUsage error:",e)))},[b]),(0,s.useEffect)(()=>{if(!b)return;let e=(0,x.io)(m,{withCredentials:!0,transports:["websocket","polling"]});return K.current=e,e.on("connect",()=>B(!0)),e.on("disconnect",()=>B(!1)),e.on("new_message",e=>{U(t=>{var r,l;if(t.some(t=>t.message.id===e.id))return t;let s=b.user&&b.user.id===e.senderId?{id:b.user.id,name:null!=(r=b.user.name)?r:"",image:null!=(l=b.user.image)?l:void 0}:null;return[...t,{message:e,sender:s}]}),k(t=>t.map(t=>{var r,l;return t.room.id===e.roomId?{...t,lastMessage:{body:e.body,createdAt:e.createdAt,translations:null!=(r=e.translations)?r:null,imageUrl:null!=(l=e.imageUrl)?l:null}}:t}).sort((e,t)=>{var r,l;let s=(null==(r=e.lastMessage)?void 0:r.createdAt)?new Date(e.lastMessage.createdAt).getTime():new Date(e.room.createdAt).getTime();return((null==(l=t.lastMessage)?void 0:l.createdAt)?new Date(t.lastMessage.createdAt).getTime():new Date(t.room.createdAt).getTime())-s}))}),e.on("message_translated",e=>{let{id:t,roomId:r,translations:l}=e;U(e=>e.map(e=>e.message.id===t?{...e,message:{...e.message,translations:l}}:e)),r&&k(e=>e.map(e=>e.room.id===r&&e.lastMessage?{...e,lastMessage:{...e.lastMessage,translations:l}}:e))}),()=>{e.disconnect(),K.current=null}},[b]),(0,s.useEffect)(()=>{var e,t;M&&(D(!0),U([]),(0,d.VL)(M).then(U).catch(e=>console.error("[chat] getMessages error:",e)).finally(()=>D(!1)),null==(e=K.current)||e.emit("join_room",M),null==(t=K.current)||t.emit("mark_read",M))},[M]),(0,s.useEffect)(()=>{if(!M)return;let e=setTimeout(()=>{var e;return null==(e=F.current)?void 0:e.focus()},50);return()=>clearTimeout(e)},[M]),(0,s.useEffect)(()=>{var e;null==(e=O.current)||e.scrollIntoView({behavior:"smooth",block:"nearest"})},[S]),(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&P(null)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);let J=(0,s.useCallback)(()=>{let e=T.trim();e&&M&&K.current&&(H&&null!==H.left&&H.left<=0||(K.current.emit("send_message",{roomId:M,body:e,locale:w}),A(""),W(e=>e&&null!==e.left?{...e,left:e.left-1,sent:e.sent+1}:e)))},[T,M,H]),Y=(0,s.useCallback)(async e=>{if(M&&K.current){z(!0);try{let t=new FormData;t.append("file",e);let r=await fetch("".concat(m,"/api/uploads"),{method:"POST",credentials:"include",body:t});if(!r.ok)throw Error("Upload failed");let{url:l}=await r.json();K.current.emit("send_message",{roomId:M,body:"",imageUrl:l,locale:w})}catch(e){}finally{z(!1),G.current&&(G.current.value="")}}},[M,w]),Z=null!=(g=({ru:"ru-RU",en:"en-US",el:"el-GR"})[w])?g:"el-GR";if(j||C)return(0,l.jsx)("div",{className:"text-center py-20 text-white",children:y("common.loading")});let q=N.find(e=>e.room.id===M),Q=null==b||null==(e=b.user)?void 0:e.id;return(0,l.jsxs)("div",{className:"max-w-5xl mx-auto px-4 py-6 h-[calc(100vh-80px)] flex gap-4",children:[(0,l.jsxs)("div",{className:"w-72 flex-shrink-0 bg-white rounded-xl border border-gray-200 overflow-hidden flex flex-col",children:[(0,l.jsxs)("div",{className:"p-4 border-b border-gray-100",children:[(0,l.jsx)("h1",{className:"font-bold text-gray-900 text-lg",children:y("nav.chat")}),(0,l.jsxs)("div",{className:"flex items-center gap-1.5 mt-1",children:[(0,l.jsx)("span",{className:"w-2 h-2 rounded-full ".concat(R?"bg-green-400":"bg-gray-300")}),(0,l.jsx)("span",{className:"text-xs text-gray-400",children:R?y("chat.connected"):y("chat.disconnected")})]})]}),(0,l.jsx)("div",{className:"flex-1 overflow-y-auto",children:0===N.length?(0,l.jsx)("div",{className:"p-6 text-center text-gray-400 text-sm",children:y("chat.no_rooms")}):N.map(e=>{var t,r,s;let{room:n,task:a,otherUser:i,lastMessage:o}=e,c=null!=(r=null==a?void 0:a.title)?r:(0,u.H)(null==i?void 0:i.firstName,null==i?void 0:i.lastName,null==i?void 0:i.name)||y("chat.direct_chat"),d=a?(0,u.H)(null==i?void 0:i.firstName,null==i?void 0:i.lastName,null==i?void 0:i.name)||"":y("chat.direct_chat");return(0,l.jsxs)("button",{onClick:()=>{_(n.id),setTimeout(()=>{var e;return null==(e=F.current)?void 0:e.focus()},50)},className:"w-full text-left px-4 py-3 border-b border-gray-50 hover:bg-gray-50 transition ".concat(M===n.id?"bg-green-50 border-l-2 border-l-green-500":""),children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-1",children:[(0,l.jsx)("p",{className:"text-sm font-medium text-gray-800 line-clamp-1 flex-1",children:c}),o&&(0,l.jsx)("span",{className:"text-[10px] text-gray-400 shrink-0 mt-0.5",children:function(e){let t=new Date(e),r=new Date,l=Math.floor((r.getTime()-t.getTime())/6e4);return l<1?y("chat.just_now"):l<60?"".concat(l).concat(y("chat.min_ago")):t.toDateString()===r.toDateString()?t.toLocaleTimeString(Z,{hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString(Z,{day:"2-digit",month:"2-digit"})}(o.createdAt)})]}),o?(0,l.jsx)("p",{className:"text-xs text-gray-400 mt-0.5 line-clamp-1",children:o.imageUrl&&!o.body?"\uD83D\uDCF7":null!=(s=null==(t=o.translations)?void 0:t[w])?s:o.body}):a?(0,l.jsx)("p",{className:"text-xs text-gray-400 mt-0.5 line-clamp-1",children:d}):null]},n.id)})})]}),(0,l.jsx)("div",{className:"flex-1 bg-white rounded-xl border border-gray-200 flex flex-col overflow-hidden",children:M?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"px-5 py-4 border-b border-gray-100",children:(0,l.jsx)("p",{className:"font-semibold text-gray-800 text-sm",children:null!=(f=null==q||null==(t=q.task)?void 0:t.title)?f:(0,u.H)(null==q||null==(r=q.otherUser)?void 0:r.firstName,null==q||null==(a=q.otherUser)?void 0:a.lastName,null==q||null==(h=q.otherUser)?void 0:h.name)||y("chat.direct_chat")})}),(null==q?void 0:q.task)&&(0,l.jsxs)(i(),{href:"/tasks/".concat(q.task.id),className:"flex items-center gap-3 mx-5 mt-4 px-4 py-3 bg-green-50 border border-green-200 rounded-xl hover:bg-green-100 transition group",children:[(0,l.jsx)("div",{className:"w-8 h-8 rounded-lg bg-green-600 flex items-center justify-center flex-shrink-0",children:(0,l.jsxs)("svg",{className:"w-4 h-4 text-white",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,l.jsx)("path",{d:"M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2"}),(0,l.jsx)("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"})]})}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("p",{className:"text-xs text-gray-500 font-medium",children:y("chat.linked_task")}),(0,l.jsx)("p",{className:"text-sm font-semibold text-gray-800 truncate group-hover:underline",children:q.task.title})]}),(0,l.jsx)("svg",{className:"w-4 h-4 text-gray-400 flex-shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:(0,l.jsx)("polyline",{points:"9 18 15 12 9 6"})})]}),(0,l.jsxs)("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-3",children:[E?(0,l.jsx)("div",{className:"text-center text-gray-400 text-sm py-10",children:y("common.loading")}):0===S.length?(0,l.jsx)("div",{className:"text-center text-gray-400 text-sm py-10",children:y("chat.no_messages")}):S.map(e=>{var t,r,s,n,a;let{message:i,sender:o}=e,c=i.senderId===Q;return(0,l.jsxs)("div",{className:"flex gap-2.5 ".concat(c?"flex-row-reverse":""),children:[(0,l.jsx)("div",{className:"w-8 h-8 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-xs font-bold overflow-hidden",children:(null==o?void 0:o.image)?(0,l.jsx)("img",{src:o.image,alt:o.name,className:"w-full h-full object-cover"}):null!=(n=null==o||null==(r=o.name)||null==(t=r[0])?void 0:t.toUpperCase())?n:"?"}),(0,l.jsxs)("div",{className:"max-w-[70%] ".concat(c?"items-end":"items-start"," flex flex-col gap-1"),children:[!c&&(0,l.jsx)("span",{className:"text-xs text-gray-400 px-1",children:(0,u.H)(null==o?void 0:o.firstName,null==o?void 0:o.lastName,null==o?void 0:o.name)}),i.imageUrl?(0,l.jsx)("button",{type:"button",onClick:()=>P("".concat(m).concat(i.imageUrl)),className:"block focus:outline-none",children:(0,l.jsx)("img",{src:"".concat(m).concat(i.imageUrl),alt:"photo",className:"rounded-2xl max-w-[240px] max-h-[320px] object-cover cursor-pointer hover:opacity-90 transition"})}):(0,l.jsx)("div",{className:"px-4 py-2 rounded-2xl text-sm leading-relaxed ".concat(c?"bg-green-600 text-white rounded-tr-sm":"bg-gray-100 text-gray-800 rounded-tl-sm"),children:null!=(a=null==(s=i.translations)?void 0:s[w])?a:i.body}),(0,l.jsx)("span",{className:"text-xs text-gray-300 px-1",children:new Date(i.createdAt).toLocaleTimeString(Z,{hour:"2-digit",minute:"2-digit"})})]})]},i.id)}),(0,l.jsx)("div",{ref:O})]}),V&&(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm",onClick:()=>P(null),children:(0,l.jsxs)("div",{className:"relative max-w-[90vw] max-h-[90vh]",onClick:e=>e.stopPropagation(),children:[(0,l.jsx)("img",{src:V,alt:"photo",className:"max-w-[90vw] max-h-[90vh] rounded-2xl object-contain shadow-2xl"}),(0,l.jsx)("button",{onClick:()=>P(null),className:"absolute -top-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition","aria-label":"Close",children:(0,l.jsx)("svg",{className:"w-4 h-4 text-gray-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),(0,l.jsx)("a",{href:V,download:!0,target:"_blank",rel:"noreferrer",className:"absolute -bottom-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition","aria-label":"Download",onClick:e=>e.stopPropagation(),children:(0,l.jsx)("svg",{className:"w-4 h-4 text-gray-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5 5-5M12 15V3"})})})]})}),(0,l.jsxs)("div",{className:"px-4 py-3 border-t border-gray-100",children:[" ",(0,l.jsx)("input",{ref:G,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",className:"hidden",onChange:e=>{var t;let r=null==(t=e.target.files)?void 0:t[0];r&&Y(r)}})," ",H&&null!==H.left&&H.left<=0&&(0,l.jsxs)("div",{className:"mb-2 flex items-center gap-2 bg-red-50 border border-red-200 rounded-xl px-3 py-2",children:[(0,l.jsx)("svg",{className:"w-4 h-4 text-red-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),(0,l.jsx)("span",{className:"text-xs text-red-700 flex-1",children:y("chat.limit_reached","Дневной лимит сообщений исчерпан")}),(0,l.jsx)(i(),{href:"/pricing",className:"text-xs font-medium text-red-700 underline",children:y("plan.upgrade")})]}),H&&null!==H.left&&H.left>0&&H.left<=Math.ceil((H.left+H.sent)*.2)&&(0,l.jsxs)("div",{className:"mb-2 flex items-center gap-2 bg-amber-50 border border-amber-200 rounded-xl px-3 py-2",children:[(0,l.jsx)("svg",{className:"w-4 h-4 text-amber-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),(0,l.jsx)("span",{className:"text-xs text-amber-700 flex-1",children:y("chat.limit_warning","Осталось {n} сообщений сегодня").replace("{n}",String(H.left))}),(0,l.jsx)(i(),{href:"/pricing",className:"text-xs font-medium text-amber-700 underline",children:y("plan.upgrade")})]}),(0,l.jsxs)("div",{className:"flex gap-2 items-end",children:[(0,l.jsx)("button",{type:"button",onClick:()=>{var e;return null==(e=G.current)?void 0:e.click()},disabled:I||!R||!!(H&&null!==H.left&&H.left<=0),className:"h-10 w-10 text-gray-400 hover:text-gray-500 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center rounded-xl hover:bg-gray-50 transition",title:"Send photo",children:I?(0,l.jsxs)("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,l.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,l.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8H4z"})]}):(0,l.jsxs)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:[(0,l.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"3",ry:"3"}),(0,l.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),(0,l.jsx)("polyline",{points:"21 15 16 10 5 21"})]})}),(0,l.jsx)("textarea",{ref:F,value:T,onChange:e=>A(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),J())},rows:1,placeholder:y("chat.placeholder"),disabled:!!(H&&null!==H.left&&H.left<=0),className:"flex-1 border border-gray-300 rounded-xl px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none max-h-32 disabled:bg-gray-50 disabled:text-gray-400",style:{minHeight:"40px"}}),(0,l.jsx)("button",{onClick:J,disabled:!T.trim()||!R||!!(H&&null!==H.left&&H.left<=0),className:"h-10 w-10 bg-green-600 text-white rounded-xl hover:bg-green-700 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center",children:(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14M12 5l7 7-7 7"})})})]})]})]}):(0,l.jsx)("div",{className:"flex-1 flex items-center justify-center text-gray-400 text-sm",children:y("chat.select")})})]})}function g(){return(0,l.jsx)(s.Suspense,{fallback:(0,l.jsx)("div",{className:"text-center py-20 text-white",children:"..."}),children:(0,l.jsx)(h,{})})}},7016:(e,t,r)=>{Promise.resolve().then(r.bind(r,4251))}},e=>{e.O(0,[1516,9664,2838,9906,2982,587,18,7358],()=>e(e.s=7016)),_N_E=e.O()}]);^ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5105],{252:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>g});var a=t(4568),r=t(7620),l=t(7541),n=t(9664),i=t.n(n),d=t(1592),c=t(9906),o=t(2982),x=t(4017),m=t(2035);function h(e){let{current:s,limit:t,label:r,className:l=""}=e;if(null===t)return(0,a.jsxs)("div",{className:"".concat(l),children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-1",children:[(0,a.jsx)("span",{className:"text-xs text-gray-500",children:r}),(0,a.jsx)("span",{className:"text-xs font-semibold text-green-600",children:"∞"})]}),(0,a.jsx)("div",{className:"h-1.5 rounded-full bg-green-100",children:(0,a.jsx)("div",{className:"h-full w-full rounded-full bg-green-400"})})]});let n=t>0?Math.min(100,Math.round(s/t*100)):100,i=Math.max(0,t-s);return(0,a.jsxs)("div",{className:l,children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-1",children:[(0,a.jsx)("span",{className:"text-xs text-gray-500",children:r}),(0,a.jsxs)("span",{className:"text-xs font-semibold ".concat(n>=100?"text-red-600":n>=80?"text-amber-600":"text-gray-600"),children:[i," / ",t]})]}),(0,a.jsx)("div",{className:"h-1.5 rounded-full bg-gray-100",children:(0,a.jsx)("div",{className:"h-full rounded-full transition-all ".concat(n>=100?"bg-red-500":n>=80?"bg-amber-400":"bg-green-500"),style:{width:"".concat(n,"%")}})})]})}function u(e){let{dashboard:s,t}=e,r=s.plan,l=s.planExpiration,n=s.usage,d=s.stats,c=l?Math.max(0,Math.min(100,Math.round(l.daysLeft/30*100))):100,o=l?l.daysLeft<=3?"bg-red-500":l.daysLeft<=7?"bg-amber-400":"bg-green-400":"bg-green-400";return(0,a.jsxs)("div",{className:"bg-white rounded-2xl border border-gray-200 p-5 mb-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h2",{className:"font-semibold text-gray-800 text-sm",children:t("dashboard.plan.title","My Plan")}),r?(0,a.jsx)(m.d,{tier:r.tier,size:"sm"}):(0,a.jsx)("span",{className:"text-xs text-gray-400",children:t("dashboard.plan.no_plan","Free")})]}),(0,a.jsx)(i(),{href:"/pricing",className:"text-xs font-medium text-green-600 hover:underline",children:(null==r?void 0:r.tier)==="ultimate"?null:t("dashboard.plan.upgrade","Upgrade")})]}),l&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("div",{className:"flex justify-between text-xs text-gray-500 mb-1",children:[(0,a.jsx)("span",{children:t("dashboard.plan.expires","Expires in {n} days").replace("{n}",String(l.daysLeft))}),(0,a.jsxs)("span",{children:[l.daysLeft," ",t("pricing.days","days")]})]}),(0,a.jsx)("div",{className:"h-1.5 rounded-full bg-gray-100",children:(0,a.jsx)("div",{className:"h-full rounded-full transition-all ".concat(o),style:{width:"".concat(c,"%")}})})]}),(void 0!==n.messagesSent||void 0!==n.ordersMade)&&(0,a.jsxs)("div",{className:"space-y-2 mb-4",children:[(0,a.jsx)("p",{className:"text-xs font-medium text-gray-500 uppercase tracking-wide",children:t("dashboard.plan.limits","Daily limits")}),(0,a.jsx)(h,{current:n.messagesSent,limit:null!==n.messagesLeft?n.messagesSent+n.messagesLeft:null,label:t("dashboard.plan.messages","Messages")}),(0,a.jsx)(h,{current:n.ordersMade,limit:null!==n.ordersLeft?n.ordersMade+n.ordersLeft:null,label:t("dashboard.plan.orders","Orders")})]}),Object.keys(d).length>0&&(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2",children:Object.entries(d).map(e=>{let[s,r]=e;return(0,a.jsxs)("div",{className:"bg-gray-50 rounded-xl px-3 py-2 text-center",children:[(0,a.jsx)("p",{className:"text-lg font-bold text-gray-800",children:r}),(0,a.jsx)("p",{className:"text-[10px] text-gray-400 uppercase tracking-wide",children:t("dashboard.stats.".concat(s),s)})]},s)})})]})}function g(){var e,s,t;let{data:n,isPending:m}=(0,d.wV)(),h=(0,l.useRouter)(),g=(0,l.useSearchParams)(),{t:p,locale:b}=(0,c.Y)(),[f,j]=(0,r.useState)([]),[N,v]=(0,r.useState)([]),[y,w]=(0,r.useState)([]),[k,L]=(0,r.useState)([]),[M,_]=(0,r.useState)(!0),[C,E]=(0,r.useState)(null),[S,D]=(0,r.useState)(null),[B,R]=(0,r.useState)(null);if((0,r.useEffect)(()=>{m||n||h.push("/login")},[n,m]),(0,r.useEffect)(()=>{if(!n)return;let e=g.get("ref");if(!e)return;(0,o.C0)(e).catch(()=>{});let s=new URLSearchParams(g.toString());s.delete("ref");let t=s.toString()?"?".concat(s.toString()):window.location.pathname;h.replace(t)},[n]),(0,r.useEffect)(()=>{n&&(0,o.Bb)().then(e=>{let{cards:s}=e;return R(s.length>0)}).catch(()=>R(null))},[n]),(0,r.useEffect)(()=>{n&&Promise.all([(0,o.Fu)(),(0,o.aT)(),(0,o.q7)(),(0,o.Tr)(),(0,o.H)()]).then(e=>{let[s,t,a,r,l]=e;j(s),v(t),w(a),L(r.filter(e=>"task_invite"===e.type)),E(l)}).catch(()=>{}).finally(()=>_(!1))},[n]),(0,r.useEffect)(()=>{var e;n&&("specialist"===(null==(e=n.user)?void 0:e.role)?(0,o.zk)().then(D).catch(()=>{}):(0,o.ML)().then(D).catch(()=>{}))},[n]),m||M)return(0,a.jsx)("div",{className:"text-center py-20 text-white",children:p("common.loading")});let z="ru"===b?"ru-RU":"uk"===b?"uk-UA":"en"===b?"en-US":"el-GR",O=f.filter(e=>"completed"!==e.status&&"cancelled"!==e.status),P=f.filter(e=>"completed"===e.status||"cancelled"===e.status),F=N.filter(e=>{let s=e.offer||e,t=e.task;return"other_accepted"!==s.status&&(null==t?void 0:t.status)!=="completed"&&(null==t?void 0:t.status)!=="cancelled"}),H=N.filter(e=>{let s=e.offer||e,t=e.task;return"other_accepted"===s.status||(null==t?void 0:t.status)==="completed"||(null==t?void 0:t.status)==="cancelled"});function U(e){var s,t;let{task:r}=e,l=null!=(s=r.offerCount)?s:0,n=null!=(t=r.declinedCount)?t:0;return(0,a.jsx)(i(),{href:"/tasks/".concat(r.id),className:"block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition",children:(0,a.jsxs)("div",{className:"flex justify-between items-start",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-gray-900 truncate",children:(0,x.Oj)(r,b)}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:new Date(r.createdAt).toLocaleDateString(z)}),l>0&&(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-1.5",children:[(0,a.jsxs)("span",{className:"text-xs text-green-600 font-medium",children:["\uD83D\uDCBC ",l," ",p("dashboard.offers_count","предл.")]}),n>0&&(0,a.jsxs)("span",{className:"text-xs text-red-400",children:["✕ ",n," ",p("dashboard.declined_count","откл.")]})]})]}),(0,a.jsxs)("div",{className:"ml-3 text-right shrink-0",children:[(0,a.jsx)("span",{className:"text-xs px-2 py-0.5 rounded-full ".concat("open"===r.status||"in_progress"===r.status?"bg-green-100 text-green-700":"completed"===r.status?"bg-gray-100 text-gray-600":"bg-red-100 text-red-600"),children:p("task.status.".concat(r.status),r.status)}),r.budget&&(0,a.jsxs)("p",{className:"text-sm font-bold text-green-600 mt-1",children:[(0,x.$g)(r.budget),"€"]})]})]})})}function W(e){var s,t;let{row:r}=e,l=r.offer||r,n=r.task,d=(null==n?void 0:n.status)==="completed"&&"accepted"===l.status&&null!=(t=null==(s=y.find(e=>{var s;return(null==(s=e.review)?void 0:s.taskId)===(null==n?void 0:n.id)}))?void 0:s.review)?t:null;return(0,a.jsxs)(i(),{href:n?"/tasks/".concat(n.id):"#",className:"block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition",children:[(0,a.jsxs)("div",{className:"flex justify-between items-start",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-gray-900 truncate",children:(null==n?void 0:n.title)||p("chat.task_fallback")}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:new Date(l.createdAt).toLocaleDateString(z)})]}),(0,a.jsxs)("div",{className:"ml-3 text-right shrink-0",children:[(0,a.jsxs)("p",{className:"font-bold text-green-600",children:[(0,x.$g)(l.price),"€"]}),(0,a.jsx)("span",{className:"text-xs px-2 py-0.5 rounded-full mt-1 inline-block ".concat("accepted"===l.status?"bg-green-100 text-green-700":"declined"===l.status?"bg-red-100 text-red-700":"other_accepted"===l.status?"bg-green-100 text-green-600":"bg-gray-100 text-gray-700"),children:p("offer.status.".concat(l.status),l.status)})]})]}),d&&(0,a.jsxs)("div",{className:"mt-3 pt-3 border-t border-gray-100 flex items-center gap-2",children:[(0,a.jsx)("div",{className:"flex gap-0.5",children:[1,2,3,4,5].map(e=>(0,a.jsx)("span",{className:"text-sm ".concat(e<=d.rating?"text-yellow-400":"text-gray-200"),children:"★"},e))}),(0,a.jsxs)("span",{className:"text-sm font-semibold text-gray-700",children:[d.rating,"/5"]}),d.comment&&(0,a.jsx)("span",{className:"text-xs text-gray-500 truncate",children:d.comment})]}),(null==n?void 0:n.status)==="completed"&&"accepted"===l.status&&!d&&(0,a.jsx)("p",{className:"mt-2 text-xs text-gray-400",children:p("dashboard.review_pending")})]})}let T=(null==n||null==(e=n.user)?void 0:e.role)==="specialist";return(0,a.jsxs)("div",{className:"max-w-5xl mx-auto px-4 py-8",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-8",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-white",children:p("dashboard.title")}),(0,a.jsx)(i(),{href:"/tasks/new",className:"bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700",children:p("dashboard.new_task")})]}),!1===B&&(0,a.jsxs)("div",{className:"mb-6 bg-white rounded-2xl border border-gray-200 overflow-hidden",children:[(0,a.jsxs)("div",{className:"px-5 pt-5 pb-3",children:[(0,a.jsx)("h2",{className:"text-lg font-bold text-gray-900",children:p("dashboard.onboarding.title")}),(0,a.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:p("dashboard.onboarding.subtitle")})]}),(0,a.jsxs)("div",{className:"grid sm:grid-cols-2 gap-3 p-5 pt-2",children:[(0,a.jsxs)(i(),{href:"/specialist-setup",className:"group flex flex-col rounded-xl border-2 border-green-500 bg-green-50 p-4 hover:bg-green-100 transition",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)("span",{className:"text-xl",children:"\uD83D\uDEE0️"}),(0,a.jsx)("span",{className:"font-semibold text-gray-800",children:p("dashboard.onboarding.helper.title")})]}),(0,a.jsx)("p",{className:"text-sm text-green-700/80 mb-3 flex-1",children:p("dashboard.onboarding.helper.desc")}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-sm font-semibold text-green-700",children:[p("dashboard.onboarding.helper.cta")," →"]})]}),(0,a.jsxs)(i(),{href:"/tasks/new",className:"group flex flex-col rounded-xl border border-gray-200 bg-gray-50 p-4 hover:bg-gray-100 transition",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)("span",{className:"text-xl",children:"\uD83D\uDCDD"}),(0,a.jsx)("span",{className:"font-semibold text-gray-800",children:p("dashboard.onboarding.requester.title")})]}),(0,a.jsx)("p",{className:"text-sm text-gray-500 mb-3 flex-1",children:p("dashboard.onboarding.requester.desc")}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-sm font-semibold text-gray-700",children:[p("dashboard.onboarding.requester.cta")," →"]})]})]})]}),C&&(0,a.jsx)(u,{dashboard:C,t:p}),S&&(T?(S.missedCount>0||S.missedEarnings>0)&&(0,a.jsxs)("div",{className:"mb-6 bg-amber-50 border border-amber-200 rounded-xl px-5 py-4 flex items-start gap-3",children:[(0,a.jsx)("div",{className:"shrink-0 mt-0.5",children:(0,a.jsx)("svg",{className:"w-5 h-5 text-amber-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("p",{className:"text-base font-semibold text-amber-800",children:[p("fomo.specialist_missed","Вы пропустили {n} заказов").replace("{n}",String(null!=(t=S.missedCount)?t:0)),S.missedEarnings>0&&(0,a.jsxs)("span",{className:"ml-1 text-amber-600",children:["на €",S.missedEarnings]})]}),(null==(s=S.topCategories)?void 0:s.length)>0&&(0,a.jsxs)("p",{className:"text-sm text-amber-600 mt-0.5",children:[p("fomo.top_categories","Категории"),": ",S.topCategories.slice(0,3).join(", ")]})]}),(0,a.jsx)(i(),{href:"/pricing",className:"shrink-0 text-xs font-medium text-amber-700 bg-amber-100 px-3 py-1.5 rounded-lg hover:bg-amber-200 transition",children:p("dashboard.plan.upgrade")})]}):S.totalTasks>0&&(0,a.jsx)("div",{className:"mb-6 bg-green-50 border border-green-200 rounded-xl px-5 py-4",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"shrink-0 bg-green-100 rounded-xl p-2",children:(0,a.jsx)("svg",{className:"w-5 h-5 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"text-base font-semibold text-gray-800",children:[S.totalOffers," ",p("fomo.offers_received","предложений получено")]}),S.avgOffersPerTask>0&&(0,a.jsx)("p",{className:"text-sm text-gray-500",children:p("fomo.avg_offers","В среднем {n}/задача").replace("{n}",Number(S.avgOffersPerTask).toFixed(1))})]})]}),void 0!==S.completionRate&&(0,a.jsxs)("div",{className:"text-right",children:[(0,a.jsxs)("p",{className:"text-2xl font-bold text-green-700",children:[Math.round(100*S.completionRate),"%"]}),(0,a.jsx)("p",{className:"text-sm text-gray-400",children:p("fomo.completion_rate","завершено")})]})]})})),T&&(0,a.jsxs)(i(),{href:"/tasks",className:"flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 mb-8 hover:bg-green-700 transition",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("div",{className:"shrink-0 bg-white/20 rounded-xl p-2.5",children:(0,a.jsxs)("svg",{className:"w-6 h-6 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,a.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-4.35-4.35"})]})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-semibold text-base",children:p("find_tasks.title")}),(0,a.jsx)("p",{className:"text-green-100 text-sm mt-0.5",children:p("find_tasks.banner_hint")})]})]}),(0,a.jsx)("svg",{className:"w-5 h-5 shrink-0 text-white/70",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]}),(0,a.jsxs)("div",{className:"grid md:grid-cols-2 gap-8",children:[(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-white mb-4",children:[p("dashboard.my_tasks")," ",(0,a.jsxs)("span",{className:"text-white/60 font-normal text-base",children:["(",O.length,")"]})]}),0===O.length?(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500",children:[(0,a.jsx)("p",{children:p("dashboard.tasks.empty")}),(0,a.jsx)(i(),{href:"/tasks/new",className:"text-green-600 hover:underline text-sm mt-2 inline-block",children:p("dashboard.tasks.empty.cta")})]}):(0,a.jsx)("div",{className:"space-y-3",children:O.map(e=>(0,a.jsx)(U,{task:e},e.id))})]}),P.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-white/70 mb-4",children:[p("dashboard.completed_tasks")," ",(0,a.jsxs)("span",{className:"font-normal text-base text-white/50",children:["(",P.length,")"]})]}),(0,a.jsx)("div",{className:"space-y-3 opacity-75",children:P.map(e=>(0,a.jsx)(U,{task:e},e.id))})]})]}),(0,a.jsx)("div",{className:"space-y-8",children:T?(0,a.jsxs)(a.Fragment,{children:[k.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-white mb-4",children:[p("dashboard.invitations")," ",(0,a.jsxs)("span",{className:"text-white/60 font-normal text-base",children:["(",k.length,")"]})]}),(0,a.jsx)("div",{className:"space-y-3",children:k.map(e=>(0,a.jsxs)(i(),{href:e.referenceId?"/tasks/".concat(e.referenceId):"/tasks",className:"flex items-start gap-3 p-4 rounded-xl border transition cursor-pointer ".concat(e.isRead?"bg-white/90 border-white/20 hover:bg-white":"bg-white border-amber-300 shadow-sm hover:bg-amber-50"),children:[(0,a.jsx)("span",{className:"text-2xl",children:"\uD83D\uDCCB"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium truncate ".concat(e.isRead?"text-gray-600":"text-gray-900"),children:p("notif.type.task_invite",e.title)}),e.body&&(0,a.jsx)("p",{className:"text-sm text-gray-500 mt-0.5 truncate",children:(()=>{let s=function(e){var s;if(!e)return null;let t=e.match(/[«""](.+?)[»""]/);return null!=(s=null==t?void 0:t[1])?s:null}(e.body),t=p("notif.body.task_invite","");return s&&t?t.replace("{title}",s):e.body})()}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:new Date(e.createdAt).toLocaleDateString(z)})]}),(0,a.jsxs)("div",{className:"flex flex-col items-end gap-1.5 shrink-0",children:[!e.isRead&&(0,a.jsx)("span",{className:"w-2 h-2 bg-amber-400 rounded-full mt-2"}),(0,a.jsx)("span",{className:"text-xs text-gray-400",children:"→"})]})]},e.id))})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-white mb-4",children:[p("dashboard.my_offers")," ",(0,a.jsxs)("span",{className:"text-white/60 font-normal text-base",children:["(",F.length,")"]})]}),0===F.length?(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500",children:[(0,a.jsx)("p",{children:p("dashboard.offers.empty")}),(0,a.jsx)(i(),{href:"/tasks",className:"text-green-600 hover:underline text-sm mt-2 inline-block",children:p("dashboard.offers.empty.cta")})]}):(0,a.jsx)("div",{className:"space-y-3",children:F.map(e=>(0,a.jsx)(W,{row:e},(e.offer||e).id))})]}),H.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-white/70 mb-4",children:[p("dashboard.completed_offers")," ",(0,a.jsxs)("span",{className:"font-normal text-base text-white/50",children:["(",H.length,")"]})]}),(0,a.jsx)("div",{className:"space-y-3 opacity-75",children:H.map(e=>(0,a.jsx)(W,{row:e},(e.offer||e).id))})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(i(),{href:"/specialists",className:"flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 hover:bg-green-700 transition",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("div",{className:"shrink-0 bg-white/20 rounded-xl p-2.5",children:(0,a.jsx)("svg",{className:"w-6 h-6 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-semibold text-base",children:p("dashboard.customer.specialists_title")}),(0,a.jsx)("p",{className:"text-green-100 text-sm mt-0.5",children:p("dashboard.customer.specialists_hint")})]})]}),(0,a.jsx)("svg",{className:"w-5 h-5 shrink-0 text-white/70",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]}),(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,a.jsx)("h2",{className:"text-base font-semibold text-gray-800 mb-4",children:p("dashboard.customer.how_title")}),(0,a.jsx)("div",{className:"space-y-3",children:[{num:"1",text:p("dashboard.customer.step1"),icon:"M12 4v16m8-8H4"},{num:"2",text:p("dashboard.customer.step2"),icon:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"},{num:"3",text:p("dashboard.customer.step3"),icon:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}].map(e=>{let{num:s,text:t,icon:r}=e;return(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"shrink-0 w-7 h-7 rounded-full bg-green-100 text-green-600 text-sm font-bold flex items-center justify-center",children:s}),(0,a.jsx)("p",{className:"text-sm text-gray-600 pt-1",children:t})]},s)})}),(0,a.jsxs)(i(),{href:"/tasks/new",className:"mt-4 inline-block text-sm font-medium text-green-600 hover:underline",children:[f.length>0?p("dashboard.tasks.add_new"):p("dashboard.tasks.empty.cta")," →"]})]})]})})]})]})}},1592:(e,s,t)=>{"use strict";t.d(s,{CI:()=>l,Hh:()=>n,Jv:()=>r,wV:()=>i,yK:()=>a});let a=(0,t(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:r,signOut:l,signUp:n,useSession:i}=a},2035:(e,s,t)=>{"use strict";t.d(s,{d:()=>l});var a=t(4568);let r={free:{label:"Free",class:"bg-gray-100 text-gray-500 border border-gray-200",icon:""},pro:{label:"Pro",class:"bg-green-100 text-green-700 border border-green-200",icon:(0,a.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3 h-3 inline-block mr-0.5 -mt-px",children:(0,a.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})},ultimate:{label:"Ultimate",class:"bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50",icon:(0,a.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3 h-3 inline-block mr-0.5 -mt-px",children:(0,a.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})}};function l(e){let{tier:s,verified:t,size:l="sm",className:d=""}=e;if("free"===s&&!t)return null;let c="sm"===l?"text-[10px] px-1.5 py-0.5":"text-xs px-2 py-0.5";if(t&&"free"!==s)return(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full font-semibold ".concat(c," ").concat(r[s].class," ").concat(d),children:["ultimate"===s?(0,a.jsx)(n,{className:"w-3 h-3 fill-gray-900"}):(0,a.jsx)(i,{className:"w-3 h-3"}),r[s].label]});if(t)return(0,a.jsx)("span",{className:"inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(c," bg-green-100 text-green-700 border border-green-200 ").concat(d),children:(0,a.jsx)(i,{className:"w-3 h-3"})});let o=r[s];return(0,a.jsxs)("span",{className:"inline-flex items-center rounded-full font-semibold ".concat(c," ").concat(o.class," ").concat(d),children:["pro"===s&&(0,a.jsx)(n,{className:"w-3 h-3 mr-0.5 -mt-px"}),"ultimate"===s&&(0,a.jsx)(n,{className:"w-3 h-3 mr-0.5 -mt-px fill-gray-900"}),o.label]})}function n(e){let{className:s=""}=e;return(0,a.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:s,children:(0,a.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})}function i(e){let{className:s=""}=e;return(0,a.jsxs)("svg",{viewBox:"0 0 16 16",fill:"none",className:s,children:[(0,a.jsx)("path",{d:"M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z",fill:"#3B82F6"}),(0,a.jsx)("path",{d:"M5.5 8.5l1.5 1.5 3-3",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}},4017:(e,s,t)=>{"use strict";function a(e,s){return"el"===s&&e.titleEl?e.titleEl:"en"===s&&e.titleEn?e.titleEn:"ru"===s&&e.titleRu?e.titleRu:e.title}function r(e){return null==e||""===e?"":Math.round(Number(e)).toString()}function l(e,s){return"el"===s&&e.descriptionEl?e.descriptionEl:"en"===s&&e.descriptionEn?e.descriptionEn:"ru"===s&&e.descriptionRu?e.descriptionRu:e.description}t.d(s,{$g:()=>r,GZ:()=>l,Oj:()=>a})},4658:(e,s,t)=>{Promise.resolve().then(t.bind(t,252))}},e=>{e.O(0,[1516,9664,9906,2982,587,18,7358],()=>e(e.s=4658)),_N_E=e.O()}]);0 (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3698],{1258:(e,t,a)=>{"use strict";function s(e){if(!(null==e?void 0:e.trim()))return"—";let t=e.trim().split(/\s+/);return t.length<2||!t[1]?t[0]:"".concat(t[0]," ").concat(t[1][0].toUpperCase(),".")}function l(e,t,a){if(null==e?void 0:e.trim()){let a=null==t?void 0:t.trim();return a?"".concat(e.trim()," ").concat(a[0].toUpperCase(),"."):e.trim()}return s(a)}a.d(t,{E:()=>s,H:()=>l})},1592:(e,t,a)=>{"use strict";a.d(t,{CI:()=>n,Hh:()=>r,Jv:()=>l,wV:()=>i,yK:()=>s});let s=(0,a(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:l,signOut:n,signUp:r,useSession:i}=s},4017:(e,t,a)=>{"use strict";function s(e,t){return"el"===t&&e.titleEl?e.titleEl:"en"===t&&e.titleEn?e.titleEn:"ru"===t&&e.titleRu?e.titleRu:e.title}function l(e){return null==e||""===e?"":Math.round(Number(e)).toString()}function n(e,t){return"el"===t&&e.descriptionEl?e.descriptionEl:"en"===t&&e.descriptionEn?e.descriptionEn:"ru"===t&&e.descriptionRu?e.descriptionRu:e.description}a.d(t,{$g:()=>l,GZ:()=>n,Oj:()=>s})},5940:(e,t,a)=>{"use strict";a.d(t,{Ez:()=>r,V:()=>n});var s=a(4568),l=a(7620);function n(e){if(!e)return!1;let t=e.trim();return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")}function r(e){let{icon:t,alt:a="",className:r,fallback:i="\uD83D\uDCE6"}=e,o=(t||"").trim(),[d,c]=(0,l.useState)(!1);(0,l.useEffect)(()=>{c(!1)},[o]);let m=(0,l.useMemo)(()=>n(o)?o.startsWith("/api/")?"".concat("https://api.canhelp.gr").concat(o):o:"",[o]),x="/category-icons/package.svg";return n(o)?d&&o!==x?(0,s.jsx)("img",{src:x,alt:a,className:r,loading:"lazy",onError:()=>c(!0)}):d&&o===x?(0,s.jsx)("span",{className:r,children:i}):(0,s.jsx)("img",{src:m,alt:a,className:r,loading:"lazy",onError:()=>c(!0)}):(0,s.jsx)("span",{className:r,children:o||i})}},6961:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>N});var s=a(4568),l=a(7620),n=a(7541),r=a(9664),i=a.n(r),o=a(1592),d=a(9906),c=a(2982),m=a(1258),x=a(4017),u=a(5940);let g={registration_success:["userName","link","siteName","siteUrl"],email_verification:["userName","link","siteName","siteUrl"],password_reset:["userName","link","siteName","siteUrl"],new_offer:["userName","taskTitle","taskId","specialistName","price","link"],new_task:["userName","taskTitle","taskId","customerName","link"],offer_accepted:["userName","taskTitle","price","link"],new_message:["userName","senderName","preview","link"],offer_declined:["userName","taskTitle","taskId","link"],offer_other_accepted:["userName","taskTitle","taskId","link"],task_updated:["userName","taskTitle","taskId","link"],deadline_reminder:["userName","taskTitle","taskId","link"],task_archived:["userName","taskTitle","taskId","link"],referral_reward:["userName","days","planName","link"],plan_activated:["userName","planName","price","expiresAt","link"],plan_upgraded:["userName","oldPlanName","newPlanName","charged","expiresAt","link"],plan_downgrade_scheduled:["userName","currentPlanName","newPlanName","scheduledDate","link"],plan_downgrade_applied:["userName","planName","link"],plan_renewal_reminder:["userName","planName","amount","expiresAt","link"],plan_insufficient_funds:["userName","currentPlanName","requiredAmount","currentBalance","expiresAt","topUpLink"]},p=Array.from(new Set(Object.values(g).flat())),h=[{value:"/category-icons/repairs.svg",label:"Repairs & Construction"},{value:"/category-icons/repairs-alt-wrench.svg",label:"Repairs Alt: Wrench"},{value:"/category-icons/repairs-alt-hard-hat.svg",label:"Repairs Alt: Hard Hat"},{value:"/category-icons/cleaning.svg",label:"Cleaning"},{value:"/category-icons/cleaning-alt-broom.svg",label:"Cleaning Alt: Broom"},{value:"/category-icons/cleaning-alt-sparkles.svg",label:"Cleaning Alt: Sparkles"},{value:"/category-icons/moving.svg",label:"Moving & Transport"},{value:"/category-icons/moving-alt-bus.svg",label:"Moving Alt: Bus"},{value:"/category-icons/moving-alt-train.svg",label:"Moving Alt: Train"},{value:"/category-icons/tutoring.svg",label:"Tutoring & Education"},{value:"/category-icons/tutoring-alt-book-open.svg",label:"Tutoring Alt: Book Open"},{value:"/category-icons/tutoring-alt-notebook.svg",label:"Tutoring Alt: Notebook"},{value:"/category-icons/it.svg",label:"IT & Technology"},{value:"/category-icons/it-alt-monitor.svg",label:"IT Alt: Monitor"},{value:"/category-icons/it-alt-settings.svg",label:"IT Alt: Settings"},{value:"/category-icons/design.svg",label:"Design"},{value:"/category-icons/design-alt-brush.svg",label:"Design Alt: Brush"},{value:"/category-icons/design-alt-paintbrush.svg",label:"Design Alt: Paintbrush"},{value:"/category-icons/beauty.svg",label:"Beauty & Health"},{value:"/category-icons/beauty-alt-heart.svg",label:"Beauty Alt: Heart"},{value:"/category-icons/beauty-alt-stethoscope.svg",label:"Beauty Alt: Stethoscope"},{value:"/category-icons/tech-repair.svg",label:"Device Repair"},{value:"/category-icons/tech-repair-alt-smartphone.svg",label:"Device Repair Alt: Smartphone"},{value:"/category-icons/tech-repair-alt-wrench.svg",label:"Device Repair Alt: Wrench"},{value:"/category-icons/events.svg",label:"Events"},{value:"/category-icons/events-alt-calendar.svg",label:"Events Alt: Calendar"},{value:"/category-icons/events-alt-clock.svg",label:"Events Alt: Clock"},{value:"/category-icons/photo-video.svg",label:"Photo & Video"},{value:"/category-icons/photo-video-alt-image.svg",label:"Photo & Video Alt: Image"},{value:"/category-icons/photo-video-alt-video.svg",label:"Photo & Video Alt: Video"},{value:"/category-icons/pets.svg",label:"Pets"},{value:"/category-icons/pets-alt-dog.svg",label:"Pets Alt: Dog"},{value:"/category-icons/pets-alt-cat.svg",label:"Pets Alt: Cat"},{value:"/category-icons/auto.svg",label:"Automotive"},{value:"/category-icons/auto-alt-carfront.svg",label:"Automotive Alt: Car Front"},{value:"/category-icons/auto-alt-car.svg",label:"Automotive Alt: Car"},{value:"/category-icons/legal.svg",label:"Legal Services"},{value:"/category-icons/legal-alt-gavel.svg",label:"Legal Alt: Gavel"},{value:"/category-icons/legal-alt-landmark.svg",label:"Legal Alt: Landmark"},{value:"/category-icons/accounting.svg",label:"Accounting"},{value:"/category-icons/accounting-alt-receipt.svg",label:"Accounting Alt: Receipt"},{value:"/category-icons/accounting-alt-wallet.svg",label:"Accounting Alt: Wallet"},{value:"/category-icons/other.svg",label:"Other"},{value:"/category-icons/other-alt-briefcase.svg",label:"Other Alt: Briefcase"},{value:"/category-icons/other-alt-search.svg",label:"Other Alt: Search"}];function b(e,t){return e?"en"===t?e.namesEn||e.namesEl||e.slug||"":"ru"===t?e.namesRu||e.namesEl||e.slug||"":"uk"===t?e.namesUk||e.namesEl||e.slug||"":e.namesEl||e.namesEn||e.slug||"":""}function f(e,t){return e?"en"===t?e.nameEn||e.nameEl||e.slug||"":"ru"===t?e.nameRu||e.nameEl||e.slug||"":"uk"===t?e.nameUk||e.nameEl||e.slug||"":e.nameEl||e.nameEn||e.slug||"":""}function y(e){let{value:t,onChange:a,onUpload:l,uploading:n,error:r,presets:i}=e;return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 rounded-xl border border-gray-200 bg-white px-3 py-2",children:[(0,s.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-lg bg-green-50",children:(0,s.jsx)(u.Ez,{icon:t,alt:"category icon",className:"h-9 w-9 object-contain text-3xl leading-none",fallback:"\uD83D\uDCE6"})}),(0,s.jsx)("input",{value:t,onChange:e=>a(e.target.value),className:"flex-1 border-0 bg-transparent p-0 text-sm outline-none ring-0",placeholder:"/category-icons/package.svg"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("label",{className:"inline-flex cursor-pointer items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition ".concat(n?"border-gray-200 bg-gray-100 text-gray-400":"border-green-300 bg-green-50 text-green-700 hover:bg-green-100"),children:[n?"Uploading...":"Upload SVG",(0,s.jsx)("input",{type:"file",accept:".svg,image/svg+xml",className:"hidden",disabled:n,onChange:async e=>{var t;let a=null==(t=e.target.files)?void 0:t[0];a&&(await l(a),e.target.value="")}})]}),(0,s.jsx)("span",{className:"text-xs text-gray-500",children:"or choose from presets"})]}),(0,s.jsx)("p",{className:"text-[11px] text-gray-500",children:"Preset source: /public/category-icons/presets.json"}),r?(0,s.jsx)("p",{className:"text-xs text-red-600",children:r}):null,(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4",children:i.map(e=>{let l=t===e.value;return(0,s.jsxs)("button",{type:"button",onClick:()=>a(e.value),className:"flex h-20 flex-col items-center justify-center gap-1 rounded-lg border px-2 transition ".concat(l?"border-green-500 bg-green-50 shadow-sm":"border-gray-200 bg-white hover:border-green-300 hover:bg-green-50"),"aria-label":e.label,title:e.label,children:[(0,s.jsx)(u.Ez,{icon:e.value,alt:e.label,className:"h-8 w-8 object-contain text-3xl leading-none",fallback:"\uD83D\uDCE6"}),(0,s.jsx)("span",{className:"max-w-full truncate text-[11px] font-medium text-gray-600 leading-tight",children:e.label})]},e.value)})})]})}function v(e){let{catRows:t,locale:a,selected:n,onAdd:r,addLabel:i}=e,[o,d]=(0,l.useState)(!1),[c,m]=(0,l.useState)(""),[x,g]=(0,l.useState)(null),p=(0,l.useRef)(null);(0,l.useEffect)(()=>{function e(e){p.current&&!p.current.contains(e.target)&&(d(!1),m(""))}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let h=t.filter(e=>!e.parentId),f=c.toLowerCase(),y=e=>{var t;return!c||b(e,a).toLowerCase().includes(f)||(null!=(t=e.slug)?t:"").toLowerCase().includes(f)};return(0,s.jsxs)("div",{className:"relative",ref:p,children:[(0,s.jsxs)("button",{type:"button",onClick:()=>d(e=>!e),className:"w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(o?"rounded-t-lg border border-green-400 bg-white text-gray-900":"rounded-lg border border-gray-300 bg-white hover:bg-gray-50 text-gray-500 hover:text-gray-700"),children:[(0,s.jsx)("svg",{className:"w-3.5 h-3.5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 10h16M4 14h16M4 18h16"})}),(0,s.jsx)("span",{className:"flex-1 text-left truncate",children:i}),(0,s.jsx)("svg",{className:"w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(o?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),o&&(0,s.jsxs)("div",{className:"absolute left-0 top-full w-full min-w-[240px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-72 overflow-y-auto",children:[(0,s.jsx)("div",{className:"sticky top-0 bg-white px-3 py-2 border-b border-gray-100",children:(0,s.jsx)("input",{autoFocus:!0,value:c,onChange:e=>m(e.target.value),placeholder:"Поиск...",className:"w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300"})}),h.map(e=>{let l=t.filter(t=>t.parentId===e.id),i=b(e,a),o=x===e.id,p=l.filter(e=>!n.includes(e.slug)&&y(e)),h=!n.includes(e.slug)&&y(e),f=l.length>0;return!h&&0===p.length&&c?null:(0,s.jsxs)("div",{children:[(0,s.jsxs)("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-left hover:bg-gray-50 text-gray-800",onClick:()=>{f&&!c?g(o?null:e.id):h&&(r(e.slug),d(!1),m(""))},children:[e.icon?(0,s.jsx)(u.Ez,{icon:e.icon,alt:i,className:"h-5 w-5 shrink-0 object-contain text-sm leading-none",fallback:"\uD83D\uDCE6"}):null,(0,s.jsx)("span",{className:"flex-1 font-medium",children:i}),f&&!c?(0,s.jsx)("svg",{className:"w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(o?"rotate-90":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}):null]}),(o||!!c)&&p.map(e=>(0,s.jsxs)("button",{type:"button",className:"w-full flex items-center gap-2 pl-8 pr-3 py-1.5 text-xs text-left bg-gray-50 hover:bg-gray-100 text-gray-600",onClick:()=>{r(e.slug),d(!1),m("")},children:[(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0"}),(0,s.jsx)("span",{className:"flex-1",children:b(e,a)})]},e.id))]},e.id)})]})]})}function j(e){let{locRows:t,locale:a,selected:n,onAdd:r,addLabel:i}=e,[o,d]=(0,l.useState)(!1),[c,m]=(0,l.useState)(""),[x,u]=(0,l.useState)(null),g=(0,l.useRef)(null);(0,l.useEffect)(()=>{function e(e){g.current&&!g.current.contains(e.target)&&(d(!1),m(""))}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let p=t.filter(e=>!e.parentId),h=c.toLowerCase(),b=e=>{var t;return!c||f(e,a).toLowerCase().includes(h)||(null!=(t=e.slug)?t:"").toLowerCase().includes(h)};return(0,s.jsxs)("div",{className:"relative",ref:g,children:[(0,s.jsxs)("button",{type:"button",onClick:()=>d(e=>!e),className:"w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(o?"rounded-t-lg border border-green-400 bg-white text-gray-900":"rounded-lg border border-gray-300 bg-white hover:bg-gray-50 text-gray-500 hover:text-gray-700"),children:[(0,s.jsxs)("svg",{className:"w-3.5 h-3.5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),(0,s.jsx)("span",{className:"flex-1 text-left truncate",children:i}),(0,s.jsx)("svg",{className:"w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(o?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),o&&(0,s.jsxs)("div",{className:"absolute left-0 top-full w-full min-w-[220px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-72 overflow-y-auto",children:[(0,s.jsx)("div",{className:"sticky top-0 bg-white px-3 py-2 border-b border-gray-100",children:(0,s.jsx)("input",{autoFocus:!0,value:c,onChange:e=>m(e.target.value),placeholder:"Поиск...",className:"w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300"})}),p.map(e=>{let l=t.filter(t=>t.parentId===e.id),i=f(e,a),o=x===e.id,g=l.length>0,p=l.filter(e=>!n.includes(e.slug)&&b(e)),h=!n.includes(e.slug)&&b(e);return!h&&0===p.length&&c?null:(0,s.jsxs)("div",{children:[(0,s.jsxs)("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-left hover:bg-gray-50 text-gray-800",onClick:()=>{g&&!c?u(o?null:e.id):h&&(r(e.slug),d(!1),m(""))},children:[(0,s.jsx)("svg",{className:"w-3 h-3 text-gray-300 shrink-0",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"})}),(0,s.jsx)("span",{className:"flex-1 font-medium",children:i}),g&&!c?(0,s.jsx)("svg",{className:"w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(o?"rotate-90":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}):null]}),(o||!!c)&&p.map(e=>(0,s.jsxs)("button",{type:"button",className:"w-full flex items-center gap-2 pl-8 pr-3 py-1.5 text-xs text-left bg-gray-50 hover:bg-gray-100 text-gray-600",onClick:()=>{r(e.slug),d(!1),m("")},children:[(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0"}),(0,s.jsx)("span",{className:"flex-1",children:f(e,a)})]},e.id))]},e.id)})]})]})}function N(){var e,t,a,r,u,N,_,S,L,M,T,I,R,W,z,P,F,H,V,O,K,q,G,X,Y,J,$,Q,Z,ee,et,ea,es,el,en;let er=(0,n.useRouter)(),{data:ei,isPending:eo}=(0,o.wV)(),{t:ed,locale:ec}=(0,d.Y)(),[em,ex]=(0,l.useState)("stats"),[eu,eg]=(0,l.useState)(!1);(0,l.useEffect)(()=>{eg(window.innerWidth<1024)},[]);let[ep,eh]=(0,l.useState)(null),[eb,ef]=(0,l.useState)([]),[ey,ev]=(0,l.useState)(1),[ej,eN]=(0,l.useState)(0),[ek,ew]=(0,l.useState)(""),[eC,e_]=(0,l.useState)(""),[eS,eL]=(0,l.useState)(""),[eE,eD]=(0,l.useState)([]),[eM,eA]=(0,l.useState)(1),[eB,eT]=(0,l.useState)(0),[eI,eU]=(0,l.useState)(""),[eR,eW]=(0,l.useState)(""),[ez,eP]=(0,l.useState)(""),[eF,eH]=(0,l.useState)([]),[eV,eO]=(0,l.useState)(1),[eK,eq]=(0,l.useState)(0),[eG,eX]=(0,l.useState)(0),[eY,eJ]=(0,l.useState)([]),[e$,eQ]=(0,l.useState)(1),[eZ,e0]=(0,l.useState)(0),[e1,e2]=(0,l.useState)(!1),[e4,e5]=(0,l.useState)(0),[e3,e6]=(0,l.useState)([]),[e7,e8]=(0,l.useState)(1),[e9,te]=(0,l.useState)(0),[tt,ta]=(0,l.useState)(""),[ts,tl]=(0,l.useState)(""),[tn,tr]=(0,l.useState)(""),[ti,to]=(0,l.useState)(""),[td,tc]=(0,l.useState)(null),[tm,tx]=(0,l.useState)(""),[tu,tg]=(0,l.useState)(!1),[tp,th]=(0,l.useState)([]),[tb,tf]=(0,l.useState)(1),[ty,tv]=(0,l.useState)(0),[tj,tN]=(0,l.useState)([]),[tk,tw]=(0,l.useState)(0),[tC,t_]=(0,l.useState)(1),[tS,tL]=(0,l.useState)(""),[tE,tD]=(0,l.useState)(""),[tM,tA]=(0,l.useState)(""),[tB,tT]=(0,l.useState)(""),[tI,tU]=(0,l.useState)([]),[tR,tW]=(0,l.useState)([]),[tz,tP]=(0,l.useState)(0),[tF,tH]=(0,l.useState)(1),[tV,tO]=(0,l.useState)(""),[tK,tq]=(0,l.useState)(""),[tG,tX]=(0,l.useState)(""),[tY,tJ]=(0,l.useState)([]),[t$,tQ]=(0,l.useState)("ai"),[tZ,t0]=(0,l.useState)([]),[t1,t2]=(0,l.useState)(1),[t4,t5]=(0,l.useState)(0),[t3,t6]=(0,l.useState)(""),[t7,t8]=(0,l.useState)([]),[t9,ae]=(0,l.useState)(""),[at,aa]=(0,l.useState)(""),[as,al]=(0,l.useState)([]),[an,ar]=(0,l.useState)([]),[ai,ao]=(0,l.useState)([]),[ad,ac]=(0,l.useState)(0),[am,ax]=(0,l.useState)(1),[au,ag]=(0,l.useState)(""),[ap,ah]=(0,l.useState)(""),[ab,af]=(0,l.useState)(!1),[ay,av]=(0,l.useState)(!1),[aj,aN]=(0,l.useState)(null),[ak,aw]=(0,l.useState)(!1),[aC,a_]=(0,l.useState)(!1),[aS,aL]=(0,l.useState)("profile"),[aE,aD]=(0,l.useState)(null),[aM,aA]=(0,l.useState)(""),[aB,aT]=(0,l.useState)([]),[aI,aU]=(0,l.useState)(!1),[aR,aW]=(0,l.useState)({}),[az,aP]=(0,l.useState)({}),[aF,aH]=(0,l.useState)({}),[aV,aO]=(0,l.useState)({}),[aK,aq]=(0,l.useState)([]),[aG,aX]=(0,l.useState)(null),[aY,aJ]=(0,l.useState)(!1),[a$,aQ]=(0,l.useState)([]),[aZ,a0]=(0,l.useState)(null),[a1,a2]=(0,l.useState)(!1),[a4,a5]=(0,l.useState)(new Set),[a3,a6]=(0,l.useState)([]),[a7,a8]=(0,l.useState)(null),[a9,se]=(0,l.useState)(!1),[st,sa]=(0,l.useState)(new Set),[ss,sl]=(0,l.useState)(!1),[sn,sr]=(0,l.useState)(null),[si,so]=(0,l.useState)(h),[sd,sc]=(0,l.useState)(new Set),[sm,sx]=(0,l.useState)({}),[su,sg]=(0,l.useState)(new Set),[sp,sh]=(0,l.useState)(null),[sb,sf]=(0,l.useState)(!1),[sy,sv]=(0,l.useState)("general"),[sj,sN]=(0,l.useState)({siteName:"CanHelp",siteUrl:"",contactEmail:"",supportPhone:""}),[sk,sw]=(0,l.useState)(!1),[sC,s_]=(0,l.useState)(!1),[sS,sL]=(0,l.useState)({host:"",port:"587",username:"",password:"",fromName:"CanHelp",fromEmail:"",encryption:"tls"}),[sE,sD]=(0,l.useState)(!1),[sM,sA]=(0,l.useState)(!1),[sB,sT]=(0,l.useState)(!1),[sI,sU]=(0,l.useState)(null),[sR,sW]=(0,l.useState)({email_verification:{subject:"Подтвердите ваш email — {{siteName}}",body:""},registration_success:{subject:"Добро пожаловать в {{siteName}}!",body:""},password_reset:{subject:"Восстановление пароля — {{siteName}}",body:""},new_offer:{subject:"Новое предложение по вашей задаче \xab{{taskTitle}}\xbb",body:""},new_task:{subject:"Новая задача: {{taskTitle}}",body:""},offer_accepted:{subject:"Ваше предложение принято: {{taskTitle}}",body:'
Ваше предложение принято! \uD83C\uDF89
Привет, {{userName}}!
Заказчик принял ваше предложение на выполнение задачи:
{{taskTitle}}
Сумма: {{price}}€
Открыть чат →'},new_message:{subject:"Новое сообщение от {{senderName}}",body:'
Новое сообщение
Привет, {{userName}}!
Вам написал(а) {{senderName}}:
Ответить →'},offer_declined:{subject:"Ваше предложение отклонено: {{taskTitle}}",body:'
Ваше предложение отклонено
Привет, {{userName}}!
К сожалению, заказчик отклонил ваше предложение на:
Найти другие заказы →'},offer_other_accepted:{subject:"Выбран другой исполнитель: {{taskTitle}}",body:'
Выбран другой исполнитель
Привет, {{userName}}!
Заказчик выбрал другого исполнителя для задания:
Найти другие заказы →'},task_updated:{subject:"Задание обновлено: {{taskTitle}}",body:'
Задание обновлено
Привет, {{userName}}!
Заказчик обновил детали задания:
Смотреть заказ →'},deadline_reminder:{subject:"Задание истекает завтра: {{taskTitle}}",body:'
Напоминание о дедлайне
Привет, {{userName}}!
Ваше задание истекает через 24 часа. Обновите дедлайн, иначе задание будет автоматически снято с публикации.
Редактировать задание →'},task_archived:{subject:"Задание снято с публикации: {{taskTitle}}",body:'
Задание переведено в черновик
Привет, {{userName}}!
Ваше задание истекло и было автоматически переведено в черновик. Обновите дедлайн, чтобы опубликовать его снова.
Редактировать задание →'},referral_reward:{subject:"Вы получили реферальную награду — {{siteName}}",body:'
Вы получили реферальную награду! \uD83C\uDF81
Привет, {{userName}}!
Друг зарегистрировался по вашей реферальной ссылке. На ваш аккаунт добавлено {{days}} дней доступа к плану {{planName}}!
+{{days}} дней — {{planName}}
Перейти к аккаунту →'},referral_reward_el:{subject:"Λάβατε ανταμοιβή παραπομπής — {{siteName}}",body:'
Λάβατε ανταμοιβή παραπομπής! \uD83C\uDF81
Γεια {{userName}},
Ένας φίλος εγγράφηκε χρησιμοποιώντας τον σύνδεσμο παραπομπής σας. Στον λογαριασμό σας προστέθηκαν {{days}} ημέρες πρόσβασης στο πλάνο {{planName}}!
+{{days}} ημέρες — {{planName}}
Δες τον λογαριασμό σου →'},referral_reward_en:{subject:"You received a referral reward — {{siteName}}",body:'
You received a referral reward! \uD83C\uDF81
Hi {{userName}},
A friend registered using your referral link. {{days}} days of {{planName}} access have been added to your account!
+{{days}} days — {{planName}}
View your account →'},referral_reward_ru:{subject:"Вы получили реферальную награду — {{siteName}}",body:'
Вы получили реферальную награду! \uD83C\uDF81
Привет, {{userName}}!
Друг зарегистрировался по вашей реферальной ссылке. На ваш аккаунт добавлено {{days}} дней доступа к плану {{planName}}!
+{{days}} дней — {{planName}}
Перейти к аккаунту →'}}),[sz,sP]=(0,l.useState)(null),[sF,sH]=(0,l.useState)("el"),[sV,sO]=(0,l.useState)(!1),[sK,sq]=(0,l.useState)(!1),[sG,sX]=(0,l.useState)({merchantId:"",apiUser:"",apiPassword:"",environment:"test",confirmationUrl:"",cancelUrl:"",enabled:!1}),[sY,sJ]=(0,l.useState)(!1),[s$,sQ]=(0,l.useState)(!1),[sZ,s0]=(0,l.useState)({enabled:!1,planId:"",days:"30"}),[s1,s2]=(0,l.useState)(!1),[s4,s5]=(0,l.useState)(!1),[s3,s6]=(0,l.useState)({maintenanceMode:!1,indexingEnabled:!0,headScripts:"",siteTitleEl:"",siteTitleEn:"",siteTitleRu:"",siteTitleUk:"",siteDescriptionEl:"",siteDescriptionEn:"",siteDescriptionRu:"",siteDescriptionUk:""}),[s7,s8]=(0,l.useState)(!1),[s9,le]=(0,l.useState)(!1),[lt,la]=(0,l.useState)("el"),[ls,ll]=(0,l.useState)({telegram:"",instagram:"",facebook:"",twitter:"",youtube:"",tiktok:"",whatsapp:"",viber:""}),[ln,lr]=(0,l.useState)(!1),[li,lo]=(0,l.useState)(!1),[ld,lc]=(0,l.useState)({botToken:"",adminChatId:"",channelIdEl:"",channelIdEn:"",channelIdRu:"",channelIdUk:"",notifyRegistrations:!1,postNewTasks:!1}),[lm,lx]=(0,l.useState)(!1),[lu,lg]=(0,l.useState)(!1),[lp,lh]=(0,l.useState)(!1),[lb,lf]=(0,l.useState)(!1),[ly,lv]=(0,l.useState)(null),[lj,lN]=(0,l.useState)(null),[lk,lw]=(0,l.useState)(null),[lC,l_]=(0,l.useState)({}),[lS,lL]=(0,l.useState)(!1),[lE,lD]=(0,l.useState)(null),[lM,lA]=(0,l.useState)(!1),[lB,lT]=(0,l.useState)(!1),[lI,lU]=(0,l.useState)([]),[lR,lW]=(0,l.useState)(!1),[lz,lP]=(0,l.useState)([]),[lF,lH]=(0,l.useState)(!1),[lV,lO]=(0,l.useState)(null),[lK,lq]=(0,l.useState)(null),[lG,lX]=(0,l.useState)(null),[lY,lJ]=(0,l.useState)(!1),l$=e=>{lX(e),lJ(!1)},lQ=e=>{lX(e),lJ(!0)},[lZ,l0]=(0,l.useState)(null),[l1,l2]=(0,l.useState)(!1),[l4,l5]=(0,l.useState)("uk"),[l3,l6]=(0,l.useState)("el"),[l7,l8]=(0,l.useState)({}),[l9,ne]=(0,l.useState)(null),[nt,na]=(0,l.useState)(null),[ns,nl]=(0,l.useState)(null),[nn,nr]=(0,l.useState)(!1),[ni,no]=(0,l.useState)(new Set),[nd,nc]=(0,l.useState)("broadcast"),[nm,nx]=(0,l.useState)(""),[nu,ng]=(0,l.useState)(""),[np,nh]=(0,l.useState)(""),[nb,nf]=(0,l.useState)("general"),[ny,nv]=(0,l.useState)(""),[nj,nN]=(0,l.useState)(!0),[nk,nw]=(0,l.useState)(!1),[nC,n_]=(0,l.useState)(null),[nS,nL]=(0,l.useState)(null),[nE,nD]=(0,l.useState)(!1),nM=!eo&&ei&&(null==(e=ei.user)?void 0:e.role)==="admin";async function nA(){if(nu.trim()){if("user"===nd&&!nm.trim())return void nL("Укажите ID пользователя");nw(!0),nL(null),n_(null);try{let e={title:nu.trim(),body:np.trim()||void 0,type:nb.trim()||void 0,referenceId:ny.trim()||void 0};if("broadcast"===nd){let t=await c.V7({...e,onlyActive:nj});n_(t)}else{let t=await c.g1(nm.trim(),e);n_(t)}}catch(e){nL((null==e?void 0:e.message)||"Не удалось отправить push")}finally{nw(!1)}}}async function nB(e,t){let a=t?c.Wi:c.He,s=await a(e).catch(()=>null);s&&ef(t=>t.map(t=>t.id===e?s:t))}function nT(e,t){return e?"THIRD_PARTY_AUTH_ERROR"===e?"Ошибка APNs/Firebase iOS: проверьте Apple APNs Auth Key (.p8) и связку Firebase проекта для iOS-приложения":"UNREGISTERED"===e?"Токен устройства больше не валиден":"INVALID_ARGUMENT"===e?"Некорректный токен или payload":"REQUEST_FAILED"===e?t||"FCM request failed before response":t?"".concat(e,": ").concat(t):e:t||"FCM принял 0 сообщений"}async function nI(){if(aj){aw(!0);try{var e,t,a,s,l,n;let r=await c.wl(aj.id,{firstName:aj.firstName,lastName:aj.lastName,phone:aj.phone||null,bio:aj.bio||null,role:aj.role,planId:aj.planId||null,isActive:aj.isActive,locale:aj.locale,languages:null!=(e=aj.languages)?e:[],personalSiteSlug:aj.personalSiteSlug||null,showContactInfo:null!=(t=aj.showContactInfo)&&t,notifyNewTasks:null!=(a=aj.notifyNewTasks)&&a,notifMessages:null==(s=aj.notifMessages)||s,skills:null!=(l=aj.skills)?l:[],siteSettings:null!=(n=aj.siteSettings)?n:{}});await Promise.all(aB.map(e=>{var t,a,s;return c.oq(e.id,{title:e.title,description:e.description||null,skills:null!=(t=e.skills)?t:[],categories:null!=(a=e.categories)?a:[],locations:null!=(s=e.locations)?s:[],isActive:e.isActive}).catch(()=>null)})),ef(e=>e.map(e=>e.id===aj.id?r:e)),aN(null)}catch(e){}finally{aw(!1)}}}async function nU(){if(aj){a_(!0);try{let e=await c.uQ(aj.id);aN(t=>t?{...t,emailVerified:e.emailVerified}:t),ef(t=>t.map(t=>t.id===aj.id?{...t,emailVerified:e.emailVerified}:t))}catch(e){}finally{a_(!1)}}}async function nR(){if(!aj)return;let e=Number(aj.topUpAmount);if(e&&!(e<=0)){af(!0);try{let t=await c.P0(aj.id,{amount:e,description:aj.topUpDescription||void 0});ef(e=>e.map(e=>e.id===aj.id?t.user:e)),aN(e=>e?{...e,...t.user,topUpAmount:"",topUpDescription:""}:e),"balances"===em&&c.g0({page:am,userId:au||void 0,kind:ap||void 0}).then(e=>{ao(e.data),ac(e.total)}).catch(()=>{})}catch(e){}finally{af(!1)}}}async function nW(){if(!aj)return;let e=Number(aj.withdrawAmount);if(e&&!(e<=0)){av(!0);try{let t=await c.hD(aj.id,{amount:e,description:aj.withdrawDescription||void 0});ef(e=>e.map(e=>e.id===aj.id?t.user:e)),aN(e=>e?{...e,...t.user,withdrawAmount:"",withdrawDescription:""}:e),"balances"===em&&c.g0({page:am,userId:au||void 0,kind:ap||void 0}).then(e=>{ao(e.data),ac(e.total)}).catch(()=>{})}catch(e){}finally{av(!1)}}}async function nz(e){let t=aB.find(t=>t.id===e);if(t){aP(t=>({...t,[e]:!0}));try{var a,s,l;let n=await c.oq(e,{title:t.title,description:t.description||null,skills:null!=(a=t.skills)?a:[],categories:null!=(s=t.categories)?s:[],locations:null!=(l=t.locations)?l:[],isActive:t.isActive});aT(t=>t.map(t=>t.id===e?n:t))}catch(e){}finally{aP(t=>({...t,[e]:!1}))}}}async function nP(e,t){let a=await c.oq(e,{isActive:t}).catch(()=>null);a&&(eJ(t=>t.map(t=>t.id===e?a:t)),(null==aj?void 0:aj.id)===a.specialistId&&aT(t=>t.map(t=>t.id===e?a:t)),c.z5(1,"pending").then(e=>eX(e.total)).catch(()=>{}),c.s_(1,"inactive").then(e=>e5(e.total)).catch(()=>{}))}async function nF(e){let t=await c.nf(e).catch(()=>null);if(t){let a=t.task||t;eD(t=>t.map(t=>(t.task||t).id===e?{...t,task:a}:t))}}async function nH(e,t){window.confirm("".concat(ed("admin.tasks.delete.confirm"),'\n"').concat(t,'"'))&&await c.GB(e).catch(()=>null)&&eD(t=>t.filter(t=>{var a;return((null==(a=t.task)?void 0:a.id)||t.id)!==e}))}async function nV(e,t){let a=await c.eU(e,t).catch(()=>null);a&&eH(t=>t.map(t=>t.id===e?{...t,...a}:t))}function nO(e){a0({parentId:null!=e?e:null,slug:"",nameEl:"",nameEn:"",nameRu:"",nameUk:"",order:0,isActive:!0})}async function nK(){if(aZ){a2(!0);try{if(aZ.id){let e=await c.Nt(aZ.id,aZ);aQ(t=>t.map(t=>t.id===aZ.id?e:t))}else{let e=await c.yJ({slug:aZ.slug,nameEl:aZ.nameEl,nameEn:aZ.nameEn,nameRu:aZ.nameRu,nameUk:aZ.nameUk,parentId:aZ.parentId,order:aZ.order});aQ(t=>[...t,e])}a0(null)}catch(e){}finally{a2(!1)}}}async function nq(e,t){window.confirm("".concat(ed("admin.loc.delete.confirm"),'\n"').concat(t,'"'))&&await c.zR(e).catch(()=>null)&&aQ(t=>t.filter(t=>t.id!==e))}function nG(e){sr(null),a8({parentId:null!=e?e:null,slug:"",icon:"/category-icons/package.svg",namesEl:"",namesEn:"",namesRu:"",namesUk:"",order:0,isActive:!0})}async function nX(e){if("image/svg+xml"!==e.type)return void sr("Only SVG files are allowed");sl(!0),sr(null);try{let t=new FormData;t.append("file",e);let a=await fetch("".concat("https://api.canhelp.gr","/api/uploads"),{method:"POST",credentials:"include",body:t});if(!a.ok){let e=await a.json().catch(()=>({error:"Upload failed"}));throw Error(e.error||"Upload failed")}let s=await a.json();a8(e=>e?{...e,icon:s.url}:e)}catch(e){sr((null==e?void 0:e.message)||"Upload failed")}finally{sl(!1)}}async function nY(){if(a7){se(!0);try{if(a7.id){let e=await c.$7(a7.id,a7);a6(t=>t.map(t=>t.id===a7.id?e:t))}else{let e=await c.zZ({slug:a7.slug,icon:a7.icon,namesEl:a7.namesEl,namesEn:a7.namesEn,namesRu:a7.namesRu,namesUk:a7.namesUk,parentId:a7.parentId,order:a7.order});a6(t=>[...t,e])}a8(null)}catch(e){}finally{se(!1)}}}async function nJ(e,t){window.confirm("".concat(ed("admin.cat.delete.confirm"),'\n"').concat(t,'"'))&&await c.K7(e).catch(()=>null)&&a6(t=>t.filter(t=>t.id!==e))}async function n$(e){let t=e.id,a=e.slug;if(sc(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a}),!sm[a]){sg(e=>new Set(e).add(t));try{let e=await c.i_(a);sx(t=>({...t,[a]:e}))}catch(e){}finally{sg(e=>{let a=new Set(e);return a.delete(t),a})}}}async function nQ(){if(sp){sf(!0);try{if(sp.id){let e=await c.fP(sp.id,{nameEl:sp.nameEl,nameEn:sp.nameEn,nameRu:sp.nameRu,nameUk:sp.nameUk,order:sp.order});sx(t=>{var a;return{...t,[sp.catSlug]:(null!=(a=t[sp.catSlug])?a:[]).map(t=>t.id===sp.id?e:t)}})}else{let e=await c.S9({categorySlug:sp.catSlug,nameEl:sp.nameEl,nameEn:sp.nameEn,nameRu:sp.nameRu,nameUk:sp.nameUk,order:sp.order});sx(t=>{var a;return{...t,[sp.catSlug]:[...null!=(a=t[sp.catSlug])?a:[],e]}})}sh(null)}catch(e){}finally{sf(!1)}}}async function nZ(e,t){(e._skipConfirm||window.confirm('Удалить навык "'.concat(e.nameEl,'"?')))&&(e._skipConfirm||await c.hp(e.id).catch(()=>null))&&sx(a=>{var s;return{...a,[t]:(null!=(s=a[t])?s:[]).filter(t=>t.id!==e.id)}})}async function n0(){if(aG){aJ(!0);try{let e={name:aG.name,description:aG.description||void 0,role:aG.role,tier:aG.tier,price:aG.price,oldPrice:aG.oldPrice||null,currency:aG.currency,maxTasks:aG.maxTasks?Number(aG.maxTasks):null,maxOffers:aG.maxOffers?Number(aG.maxOffers):null,maxCards:aG.maxCards?Number(aG.maxCards):null,maxMessagesPerDay:aG.maxMessagesPerDay?Number(aG.maxMessagesPerDay):null,maxOrdersPerDay:aG.maxOrdersPerDay?Number(aG.maxOrdersPerDay):null,maxSkills:aG.maxSkills?Number(aG.maxSkills):null,durationDays:aG.durationDays?Number(aG.durationDays):null,notifyNewTasks:aG.notifyNewTasks,searchBoost:aG.searchBoost,offersMultiplier:aG.offersMultiplier,canContactFreePlan:aG.canContactFreePlan,canContactProPlan:aG.canContactProPlan,canContactAll:aG.canContactAll,canShowContactInfo:aG.canShowContactInfo,canViewPhone:aG.canViewPhone,canUploadVideo:aG.canUploadVideo,hasFavorites:aG.hasFavorites,hasGoogleCalendar:aG.hasGoogleCalendar,hasVerifiedBadge:aG.hasVerifiedBadge,highlightedReviews:aG.highlightedReviews,hasPersonalSite:aG.hasPersonalSite,hasCanHelpNowStatus:aG.hasCanHelpNowStatus,hasNeedHelpStatus:aG.hasNeedHelpStatus,hasAutoResponse:aG.hasAutoResponse,hasAutoMatch:aG.hasAutoMatch,hasPriceList:aG.hasPriceList,receiveInstantDispatchFree:aG.receiveInstantDispatchFree,receiveInstantDispatchPro:aG.receiveInstantDispatchPro,features:aG.features?aG.features.split("\n").map(e=>e.trim()).filter(Boolean):[],isDefault:aG.isDefault,isActive:aG.isActive,order:aG.order};if(aG.id){let t=await c.td(aG.id,e);aq(e=>e.map(e=>e.id===aG.id?t:e))}else{let t=await c.qT(e);aq(e=>[...e,t])}aG.isDefault&&c.OX().then(aq).catch(()=>{}),aX(null)}catch(e){}finally{aJ(!1)}}}async function n1(e,t){window.confirm('Удалить тариф "'.concat(t,'"?'))&&await c.bR(e).catch(()=>null)&&aq(t=>t.filter(t=>t.id!==e))}async function n2(){sw(!0);try{await c.CX({"general.siteName":sj.siteName,"general.siteUrl":sj.siteUrl,"general.contactEmail":sj.contactEmail,"general.supportPhone":sj.supportPhone}),s_(!0),setTimeout(()=>s_(!1),2500)}catch(e){}finally{sw(!1)}}async function n4(){sD(!0);try{await c.CX({"smtp.host":sS.host,"smtp.port":sS.port,"smtp.username":sS.username,"smtp.password":sS.password,"smtp.fromName":sS.fromName,"smtp.fromEmail":sS.fromEmail,"smtp.encryption":sS.encryption}),sA(!0),setTimeout(()=>sA(!1),2500)}catch(e){}finally{sD(!1)}}async function n5(e){var t,a;let s="".concat(e,"_").concat(sF),l=null!=(a=null!=(t=sR[s])?t:sR[e])?a:{subject:"",body:""};if(l.subject||l.body){sq(!0);try{await c.jg(s,l);let t=await c.wc({subject:l.subject,body:l.body,fromLocale:sF});sW(a=>{let n={...a,[s]:l};for(let[a,s]of Object.entries(t))n["".concat(e,"_").concat(a)]=s;return n}),await Promise.all(Object.entries(t).map(t=>{let[a,s]=t;return c.jg("".concat(e,"_").concat(a),s)}))}catch(e){}finally{sq(!1)}}}async function n3(e){let t="".concat(e,"_").concat(sF);sO(!0);try{var a;await c.jg(t,null!=(a=sR[t])?a:{subject:"",body:""}),sP(null)}catch(e){}finally{sO(!1)}}async function n6(){sJ(!0);try{await c.CX({"payment.epay.merchantId":sG.merchantId,"payment.epay.apiUser":sG.apiUser,"payment.epay.apiPassword":sG.apiPassword,"payment.epay.environment":sG.environment,"payment.epay.confirmationUrl":sG.confirmationUrl,"payment.epay.cancelUrl":sG.cancelUrl,"payment.epay.enabled":String(sG.enabled)}),sQ(!0),setTimeout(()=>sQ(!1),2500)}catch(e){}finally{sJ(!1)}}async function n7(){s2(!0);try{await c.CX({referral_enabled:String(sZ.enabled),referral_plan_id:sZ.planId,referral_days:sZ.days}),s5(!0),setTimeout(()=>s5(!1),2500)}catch(e){}finally{s2(!1)}}async function n8(){s8(!0);try{await c.CX({"seo.maintenanceMode":String(s3.maintenanceMode),"seo.indexingEnabled":String(s3.indexingEnabled),"seo.headScripts":s3.headScripts,"seo.siteTitle.el":s3.siteTitleEl,"seo.siteTitle.en":s3.siteTitleEn,"seo.siteTitle.ru":s3.siteTitleRu,"seo.siteTitle.uk":s3.siteTitleUk,"seo.siteDescription.el":s3.siteDescriptionEl,"seo.siteDescription.en":s3.siteDescriptionEn,"seo.siteDescription.ru":s3.siteDescriptionRu,"seo.siteDescription.uk":s3.siteDescriptionUk}),le(!0),setTimeout(()=>le(!1),2500)}catch(e){}finally{s8(!1)}}async function n9(){lr(!0);try{await c.CX({"social.telegram":ls.telegram,"social.instagram":ls.instagram,"social.facebook":ls.facebook,"social.twitter":ls.twitter,"social.youtube":ls.youtube,"social.tiktok":ls.tiktok,"social.whatsapp":ls.whatsapp,"social.viber":ls.viber}),lo(!0),setTimeout(()=>lo(!1),2500)}catch(e){}finally{lr(!1)}}async function re(){lx(!0);try{await c.CX({"telegram.botToken":ld.botToken,"telegram.adminChatId":ld.adminChatId,"telegram.channelId.el":ld.channelIdEl,"telegram.channelId.en":ld.channelIdEn,"telegram.channelId.ru":ld.channelIdRu,"telegram.channelId.uk":ld.channelIdUk,"telegram.notifyRegistrations":String(ld.notifyRegistrations),"telegram.postNewTasks":String(ld.postNewTasks)}),lg(!0),setTimeout(()=>lg(!1),2500)}catch(e){}finally{lx(!1)}}async function rt(e){var t,a;let s=null!=(t=({admin:ld.adminChatId,el:ld.channelIdEl,en:ld.channelIdEn,ru:ld.channelIdRu,uk:ld.channelIdUk})[e])?t:"";"admin"===e?(lh(!0),lv(null)):(lw(e),l_(t=>{let a={...t};return delete a[e],a}));try{let t=await c.qX(ld.botToken,s),l={ok:t.ok,msg:t.ok?t.botName?"@".concat(t.botName):ed("admin.settings.telegram.test_ok"):null!=(a=t.error)?a:ed("admin.settings.telegram.test_fail")};"admin"===e?lv(l):l_(t=>({...t,[e]:l}))}catch(a){let t={ok:!1,msg:ed("admin.settings.telegram.test_fail")};"admin"===e?lv(t):l_(a=>({...a,[e]:t}))}finally{"admin"===e?lh(!1):lw(null)}}async function ra(){lL(!0),lD(null);try{var e;let t=await c.cl(ld.botToken);lD({ok:t.ok,msg:t.ok?"@".concat(t.botName):null!=(e=t.error)?e:ed("admin.settings.telegram.test_fail")})}catch(e){lD({ok:!1,msg:ed("admin.settings.telegram.test_fail")})}finally{lL(!1)}}if((0,l.useEffect)(()=>{var e;eo||ei||er.push("/login"),!eo&&ei&&(null==(e=ei.user)?void 0:e.role)!=="admin"&&er.push("/")},[ei,eo]),(0,l.useEffect)(()=>{nM&&(c.dE().then(eh).catch(()=>{}),c.bi().then(al).catch(()=>{}),c.u4().then(ar).catch(()=>{}),c.z5(1,"pending").then(e=>eX(e.total)).catch(()=>{}),c.s_(1,"inactive").then(e=>e5(e.total)).catch(()=>{}))},[nM]),(0,l.useEffect)(()=>{nM&&"users"===em&&(nD(!0),c.cS(ey,ek||void 0,eS||void 0).then(e=>{ef(e.data),eN(e.total)}).catch(()=>{}).finally(()=>nD(!1)))},[nM,em,ey,ek,eS]),(0,l.useEffect)(()=>{nM&&"tasks"===em&&(nD(!0),c.Yj(eM,eI||void 0,ez||void 0).then(e=>{eD(e.data),eT(e.total)}).catch(()=>{}).finally(()=>nD(!1)))},[nM,em,eM,eI,ez]),(0,l.useEffect)(()=>{nM&&"reports"===em&&(nD(!0),c.z5(eV).then(e=>{eH(e.data),eq(e.total)}).catch(()=>{}).finally(()=>nD(!1)))},[nM,em,eV]),(0,l.useEffect)(()=>{nM&&"moderation"===em&&(e2(!0),c.s_(e$,"all").then(e=>{eJ(e.data),e0(e.total)}).catch(()=>{}).finally(()=>e2(!1)))},[nM,em,e$]),(0,l.useEffect)(()=>{if(!nM||"support"!==em)return;nD(!0);let e={page:String(e7),limit:"30"};tt&&(e.status=tt),ts&&(e.type=ts),tn&&(e.q=tn),c.KZ(e).then(e=>{e6(e.data),te(e.total)}).catch(()=>{}).finally(()=>nD(!1))},[nM,em,e7,tt,ts,tn]),(0,l.useEffect)(()=>{nM&&"balances"===em&&(nD(!0),c.g0({page:am,userId:au||void 0,kind:ap||void 0}).then(e=>{ao(e.data),ac(e.total)}).catch(()=>{}).finally(()=>nD(!1)))},[nM,em,am,au,ap]),(0,l.useEffect)(()=>{nM&&"logs"===em&&("ai"===t$?(nD(!0),c.j_(tb).then(e=>{th(e.data),tv(e.total)}).catch(()=>{}).finally(()=>nD(!1))):"activity"===t$?c.yO({page:tC,event:tS||void 0,userId:tE||void 0,dateFrom:tM||void 0,dateTo:tB||void 0}).then(e=>{var t;tN(e.data),tw(e.total),(null==(t=e.eventTypes)?void 0:t.length)&&tU(e.eventTypes)}).catch(()=>{}):"mail"===t$?c.qt({page:tF,event:tV||void 0,dateFrom:tK||void 0,dateTo:tG||void 0}).then(e=>{var t;tW(e.data),tP(e.total),(null==(t=e.eventTypes)?void 0:t.length)&&tJ(e.eventTypes)}).catch(()=>{}):"notifications"===t$&&c.Br({page:t1,type:t3||void 0,dateFrom:t9||void 0,dateTo:at||void 0}).then(e=>{var t;t0(e.data),t5(e.total),(null==(t=e.notifTypes)?void 0:t.length)&&t8(e.notifTypes)}).catch(()=>{}))},[nM,em,t$,tb,tC,tS,tE,tM,tB,tF,tV,tK,tG,t1,t3,t9,at]),(0,l.useEffect)(()=>{t_(1)},[tS,tE,tM,tB]),(0,l.useEffect)(()=>{tH(1)},[tV,tK,tG]),(0,l.useEffect)(()=>{t2(1)},[t3,t9,at]),(0,l.useEffect)(()=>{nM&&"plans"===em&&c.OX().then(aq).catch(()=>{})},[nM,em]),(0,l.useEffect)(()=>{nM&&"translations"===em&&(l2(!0),c.YQ().then(e=>l0(e.tables)).catch(()=>{}).finally(()=>l2(!1)))},[nM,em]),(0,l.useEffect)(()=>{nM&&"backup"===em&&((0,c.Em)("/admin/backup/settings").then(e=>lA(!!e.autoEnabled)).catch(()=>{}),lW(!0),(0,c.Em)("/admin/backup/tables").then(e=>lU(e.tables||[])).catch(()=>{}).finally(()=>lW(!1)),(0,c.Em)("/admin/backup/list").then(e=>lP(e.files||[])).catch(()=>{}))},[nM,em]),(0,l.useEffect)(()=>{nM&&"referrals"===em&&(nr(!0),c.cJ().then(e=>nl(e)).catch(()=>{}).finally(()=>nr(!1)))},[nM,em]),(0,l.useEffect)(()=>{nM&&"users"===em&&0===aK.length&&c.OX().then(aq).catch(()=>{})},[nM,em]),(0,l.useEffect)(()=>{ev(1)},[ek,eS]),(0,l.useEffect)(()=>{eA(1)},[eI,ez]),(0,l.useEffect)(()=>{ax(1)},[au,ap]),(0,l.useEffect)(()=>{nM&&"locations"===em&&c.k_().then(aQ).catch(()=>{})},[nM,em]),(0,l.useEffect)(()=>{nM&&"categories"===em&&c.KD().then(a6).catch(()=>{})},[nM,em]),(0,l.useEffect)(()=>{nM&&fetch("/category-icons/presets.json").then(e=>e.ok?e.json():Promise.reject(Error("Failed to load presets"))).then(e=>{if(!Array.isArray(e))return;let t=e.filter(e=>!!e&&"object"==typeof e&&"string"==typeof e.value&&"string"==typeof e.label).filter(e=>e.value.startsWith("/category-icons/"));t.length>0&&so(t)}).catch(()=>{})},[nM]),(0,l.useEffect)(()=>{nM&&"settings"===em&&(0===aK.length&&c.OX().then(aq).catch(()=>{}),c.rC().then(e=>{var t,a,s,l,n,r,i,o,d,c,m,x,u,g,p,h,b,f,y,v,j,N,k,w,C,_,S,L,E,D,M,A,B,T,I,U,R,W,z,P,F,H,V,O,K,q,G,X;sN({siteName:null!=(t=e["general.siteName"])?t:"CanHelp",siteUrl:null!=(a=e["general.siteUrl"])?a:"",contactEmail:null!=(s=e["general.contactEmail"])?s:"",supportPhone:null!=(l=e["general.supportPhone"])?l:""}),sL({host:null!=(n=e["smtp.host"])?n:"",port:null!=(r=e["smtp.port"])?r:"587",username:null!=(i=e["smtp.username"])?i:"",password:null!=(o=e["smtp.password"])?o:"",fromName:null!=(d=e["smtp.fromName"])?d:"CanHelp",fromEmail:null!=(c=e["smtp.fromEmail"])?c:"",encryption:null!=(m=e["smtp.encryption"])?m:"tls"}),sX({merchantId:null!=(x=e["payment.epay.merchantId"])?x:"",apiUser:null!=(u=e["payment.epay.apiUser"])?u:"",apiPassword:null!=(g=e["payment.epay.apiPassword"])?g:"",environment:null!=(p=e["payment.epay.environment"])?p:"test",confirmationUrl:null!=(h=e["payment.epay.confirmationUrl"])?h:"",cancelUrl:null!=(b=e["payment.epay.cancelUrl"])?b:"",enabled:"true"===e["payment.epay.enabled"]}),s0({enabled:"true"===e.referral_enabled,planId:null!=(v=null!=(y=null!=(f=e.referral_plan_id)?f:e.referral_customer_plan_id)?y:e.referral_specialist_plan_id)?v:"",days:null!=(k=null!=(N=null!=(j=e.referral_days)?j:e.referral_customer_days)?N:e.referral_specialist_days)?k:"30"}),s6({maintenanceMode:"true"===e["seo.maintenanceMode"],indexingEnabled:"false"!==e["seo.indexingEnabled"],headScripts:null!=(w=e["seo.headScripts"])?w:"",siteTitleEl:null!=(_=null!=(C=e["seo.siteTitle.el"])?C:e["seo.siteTitle"])?_:"",siteTitleEn:null!=(S=e["seo.siteTitle.en"])?S:"",siteTitleRu:null!=(L=e["seo.siteTitle.ru"])?L:"",siteTitleUk:null!=(E=e["seo.siteTitle.uk"])?E:"",siteDescriptionEl:null!=(M=null!=(D=e["seo.siteDescription.el"])?D:e["seo.siteDescription"])?M:"",siteDescriptionEn:null!=(A=e["seo.siteDescription.en"])?A:"",siteDescriptionRu:null!=(B=e["seo.siteDescription.ru"])?B:"",siteDescriptionUk:null!=(T=e["seo.siteDescription.uk"])?T:""}),ll({telegram:null!=(I=e["social.telegram"])?I:"",instagram:null!=(U=e["social.instagram"])?U:"",facebook:null!=(R=e["social.facebook"])?R:"",twitter:null!=(W=e["social.twitter"])?W:"",youtube:null!=(z=e["social.youtube"])?z:"",tiktok:null!=(P=e["social.tiktok"])?P:"",whatsapp:null!=(F=e["social.whatsapp"])?F:"",viber:null!=(H=e["social.viber"])?H:""}),lc({botToken:null!=(V=e["telegram.botToken"])?V:"",adminChatId:null!=(O=e["telegram.adminChatId"])?O:"",channelIdEl:null!=(K=e["telegram.channelId.el"])?K:"",channelIdEn:null!=(q=e["telegram.channelId.en"])?q:"",channelIdRu:null!=(G=e["telegram.channelId.ru"])?G:"",channelIdUk:null!=(X=e["telegram.channelId.uk"])?X:"",notifyRegistrations:"true"===e["telegram.notifyRegistrations"],postNewTasks:"true"===e["telegram.postNewTasks"]})}).catch(()=>{}),c.Lp().then(e=>{let t={};for(let a of e)t[a.key]={subject:a.subject,body:a.body};sW(e=>({...e,...t}))}).catch(()=>{}))},[nM,em]),eo)return(0,s.jsx)("div",{className:"text-center py-20 text-gray-500",children:ed("common.loading")});let rs="ru"===ec?"ru-RU":"en"===ec?"en-US":"el-GR",rl=[{key:"stats",label:ed("admin.tab.stats"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})},{key:"users",label:ed("admin.tab.users"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"}),(0,s.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75"})]})},{key:"tasks",label:ed("admin.tab.tasks"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"})})},{key:"reports",label:ed("admin.tab.reports"),badge:eG||void 0,icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})},{key:"moderation",label:ed("admin.tab.moderation"),badge:e4||void 0,icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8c-1.1 0-2 .9-2 2v1H9a1 1 0 00-1 1v5a1 1 0 001 1h6a1 1 0 001-1v-5a1 1 0 00-1-1h-1v-1c0-1.1-.9-2-2-2zm0 0V6m0 12v-2"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 20h12"})]})},{key:"categories",label:ed("admin.tab.categories"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm10 0a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zm10 0a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"})})},{key:"locations",label:ed("admin.tab.locations"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]})},{key:"balances",label:ed("admin.tab.balances","Баланс"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-2"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 12h-6m0 0a2 2 0 100 4h6v-8h-6a2 2 0 100 4z"})]})},{key:"plans",label:ed("admin.tab.plans"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("rect",{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2"}),(0,s.jsx)("line",{x1:"1",y1:"10",x2:"23",y2:"10"})]})},{key:"logs",label:ed("admin.tab.logs"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("polyline",{points:"4 17 10 11 4 5"}),(0,s.jsx)("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})},{key:"settings",label:ed("admin.tab.settings"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"})]})},{key:"support",label:ed("admin.tab.support","Support"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z"})})},{key:"push",label:ed("admin.tab.push","Push"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 17h5l-1.4-1.4A2 2 0 0118 14.17V11a6 6 0 10-12 0v3.17a2 2 0 01-.6 1.43L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})})},{key:"backup",label:ed("admin.tab.backup","Backup"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})})},{key:"translations",label:ed("admin.tab.translations","Translations"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129"})})},{key:"dbcheck",label:ed("admin.tab.dbcheck","Проверка БД"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12c0 1.66-4.03 3-9 3S3 13.66 3 12"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4"})]})},{key:"referrals",label:"Рефералы",icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})})}],rn={open:"bg-green-100 text-green-700",in_progress:"bg-green-100 text-green-700",completed:"bg-gray-100 text-gray-600",cancelled:"bg-red-100 text-red-600",draft:"bg-yellow-100 text-yellow-700"},rr={pending:"bg-yellow-100 text-yellow-700",reviewed:"bg-green-100 text-green-700",dismissed:"bg-gray-100 text-gray-500"},ri={spam:"bg-green-100 text-green-700",inappropriate:"bg-red-100 text-red-700",fraud:"bg-purple-100 text-purple-700",duplicate:"bg-green-100 text-green-700",other:"bg-gray-100 text-gray-600"},ro=eY.filter(e=>!1===e.isActive),rd=eY.filter(e=>!1!==e.isActive);return(0,s.jsx)("div",{className:"min-h-screen bg-gray-50",children:(0,s.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-8",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("svg",{className:"w-7 h-7 text-yellow-500",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm0 3a1 1 0 000 2h14a1 1 0 000-2H5z"})}),(0,s.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:ed("admin.title")})]}),(0,s.jsxs)(i(),{href:"/",className:"flex items-center gap-1.5 text-sm text-gray-500 hover:text-green-600 transition",children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),ed("admin.back_home")]})]}),(0,s.jsxs)("div",{className:"flex gap-6",children:[(0,s.jsx)("aside",{className:"shrink-0 transition-all duration-200 ".concat(eu?"w-12":"w-52"),children:(0,s.jsxs)("nav",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,s.jsx)("button",{type:"button",onClick:()=>eg(e=>!e),title:eu?"Развернуть меню":"Свернуть меню",className:"w-full flex items-center justify-center py-2.5 text-gray-400 hover:text-gray-600 hover:bg-gray-50 border-b border-gray-100 transition",children:(0,s.jsx)("svg",{className:"w-4 h-4 transition-transform duration-200 ".concat(eu?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})})}),rl.map(e=>{let{key:t,label:a,icon:l,badge:n}=e;return(0,s.jsxs)("button",{onClick:()=>ex(t),title:eu?a:void 0,className:"w-full flex items-center py-3 text-sm font-medium text-left transition ".concat(em===t?"bg-green-50 text-green-700 border-r-2 border-green-600":"text-gray-600 hover:bg-gray-50 hover:text-gray-900"," ").concat(eu?"justify-center px-3":"gap-3 px-4"),children:[(0,s.jsx)("span",{className:"w-4 h-4 flex-shrink-0 flex items-center justify-center",children:l}),!eu&&(0,s.jsxs)("span",{className:"flex items-center gap-2 min-w-0",children:[(0,s.jsx)("span",{children:a}),n?(0,s.jsx)("span",{className:"ml-auto inline-flex min-w-5 h-5 items-center justify-center rounded-full bg-red-100 px-1.5 text-[11px] font-semibold text-red-700",children:n}):null]})]},t)})]})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:["stats"===em&&(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4",children:[{label:ed("admin.stats.users"),value:null==ep?void 0:ep.userCount,icon:(0,s.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),color:"text-green-600"},{label:ed("admin.stats.specialists"),value:null==ep?void 0:ep.specialistCount,icon:(0,s.jsxs)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),color:"text-purple-600"},{label:ed("admin.stats.tasks"),value:null==ep?void 0:ep.taskCount,icon:(0,s.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})}),color:"text-green-600"},{label:ed("admin.stats.offers"),value:null==ep?void 0:ep.offerCount,icon:(0,s.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),color:"text-green-600"},{label:ed("admin.stats.reviews"),value:null==ep?void 0:ep.reviewCount,icon:(0,s.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})}),color:"text-yellow-500"}].map(e=>{let{label:t,value:a,icon:l,color:n}=e;return(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,s.jsx)("div",{className:"mb-2 ".concat(n),children:l}),(0,s.jsx)("div",{className:"text-3xl font-bold ".concat(n),children:null!=a?a:"—"}),(0,s.jsx)("div",{className:"text-sm text-gray-500 mt-1",children:t})]},t)})}),(null==ep?void 0:ep.tasksByDay)&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsx)("h2",{className:"font-semibold text-gray-800",children:ed("admin.stats.activity_30d")}),(0,s.jsxs)("div",{className:"flex gap-4 text-xs text-gray-500",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-green-500 inline-block rounded"}),ed("admin.stats.users_label")]}),(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-purple-400 inline-block rounded"}),ed("admin.stats.specialists_label")]}),(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-green-500 inline-block rounded"}),ed("admin.stats.tasks_label")]})]})]}),(0,s.jsx)(U,{series:[{data:ep.usersByDay,color:"#3b82f6",fill:"#3b82f615",label:ed("admin.stats.users_label")},{data:ep.specialistsByDay,color:"#a855f7",fill:"#a855f710",label:ed("admin.stats.specialists_label")},{data:ep.tasksByDay,color:"#22c55e",fill:"#22c55e10",label:ed("admin.stats.tasks_label")}]})]}),(null==ep?void 0:ep.tasksByStatus)&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,s.jsx)("h2",{className:"font-semibold text-gray-800 mb-5",children:ed("admin.stats.tasks_by_status")}),(0,s.jsx)("div",{className:"space-y-3",children:(()=>{let e=ep.tasksByStatus.reduce((e,t)=>e+Number(t.count),0)||1,t={open:{label:ed("admin.task_status.open"),bg:"bg-green-50",bar:"bg-green-500"},in_progress:{label:ed("admin.task_status.in_progress"),bg:"bg-green-50",bar:"bg-green-500"},completed:{label:ed("admin.task_status.completed"),bg:"bg-gray-50",bar:"bg-gray-400"},cancelled:{label:ed("admin.task_status.cancelled"),bg:"bg-red-50",bar:"bg-red-400"},draft:{label:ed("admin.task_status.draft"),bg:"bg-yellow-50",bar:"bg-yellow-400"}},a=["open","in_progress","completed","draft","cancelled"];return[...ep.tasksByStatus].sort((e,t)=>a.indexOf(e.status)-a.indexOf(t.status)).map(a=>{var l;let{status:n,count:r}=a,i=null!=(l=t[n])?l:{label:n,bg:"bg-gray-50",bar:"bg-gray-300"},o=Math.round(Number(r)/e*100);return(0,s.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2 rounded-lg ".concat(i.bg),children:[(0,s.jsx)("span",{className:"text-sm text-gray-600 w-28 shrink-0",children:i.label}),(0,s.jsx)("div",{className:"flex-1 bg-gray-200 rounded-full h-2 overflow-hidden",children:(0,s.jsx)("div",{className:"h-full rounded-full ".concat(i.bar," transition-all"),style:{width:"".concat(o,"%")}})}),(0,s.jsx)("span",{className:"text-sm font-semibold text-gray-700 w-8 text-right",children:r}),(0,s.jsxs)("span",{className:"text-xs text-gray-400 w-8",children:[o,"%"]})]},n)})})()})]}),as.length>0&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsx)("h2",{className:"font-semibold text-gray-800",children:ed("admin.stats.notif_chart_title")}),(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-orange-500 inline-block rounded"}),ed("admin.stats.notif_label")]})]}),(0,s.jsx)(U,{series:[{data:as,color:"#f97316",fill:"#f9731615",label:ed("admin.stats.notif_label")}]})]}),an.length>0&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsx)("h2",{className:"font-semibold text-gray-800",children:ed("admin.stats.mail_chart_title")}),(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-sky-500 inline-block rounded"}),ed("admin.stats.mail_label")]})]}),(0,s.jsx)(U,{series:[{data:an,color:"#0ea5e9",fill:"#0ea5e915",label:ed("admin.stats.mail_label")}]})]}),ep&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 space-y-5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"font-semibold text-gray-800",children:ed("admin.stats.tokens_title")}),(0,s.jsxs)("div",{className:"flex gap-4 text-xs text-gray-500",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-violet-500 inline-block rounded"}),ed("admin.stats.tokens_out")]}),(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-sky-500 inline-block rounded"}),ed("admin.stats.tokens_in")]})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,s.jsxs)("div",{className:"rounded-lg bg-violet-50 border border-violet-100 px-4 py-3",children:[(0,s.jsx)("div",{className:"text-xs text-violet-600 mb-1",children:ed("admin.stats.tokens_out_label")}),(0,s.jsx)("div",{className:"text-2xl font-bold text-violet-700",children:Number(ep.totalOutputTokens).toLocaleString()})]}),(0,s.jsxs)("div",{className:"rounded-lg bg-sky-50 border border-sky-100 px-4 py-3",children:[(0,s.jsx)("div",{className:"text-xs text-sky-600 mb-1",children:ed("admin.stats.tokens_in_label")}),(0,s.jsx)("div",{className:"text-2xl font-bold text-sky-700",children:Number(ep.totalInputTokens).toLocaleString()})]}),(0,s.jsxs)("div",{className:"rounded-lg bg-emerald-50 border border-emerald-100 px-4 py-3",children:[(0,s.jsx)("div",{className:"text-xs text-emerald-600 mb-1",children:ed("admin.stats.cost_label")}),(0,s.jsxs)("div",{className:"text-2xl font-bold text-emerald-700",children:["$",Number(null!=(a=ep.totalCostUsd)?a:0).toFixed(4)]})]})]}),(null==(t=ep.tokensByMonth)?void 0:t.length)>0&&(0,s.jsx)(B,{dateLocale:rs,series:[{data:ep.tokensByMonth.map(e=>({month:e.month,count:Number(e.output)})),color:"#8b5cf6",fill:"#8b5cf610",label:ed("admin.stats.tokens_out_label")},{data:ep.tokensByMonth.map(e=>({month:e.month,count:Number(e.input)})),color:"#0ea5e9",fill:"#0ea5e915",label:ed("admin.stats.tokens_in_label")}]})]})]}),"users"===em&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex gap-3 mb-4",children:[(0,s.jsxs)("form",{className:"flex gap-2 flex-1",onSubmit:e=>{e.preventDefault(),ew(eC)},children:[(0,s.jsx)("input",{value:eC,onChange:e=>e_(e.target.value),placeholder:ed("admin.users.search.placeholder"),className:"flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"}),(0,s.jsx)("button",{type:"submit",className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700",children:ed("tasks.search.btn")})]}),(0,s.jsxs)("select",{value:eS,onChange:e=>eL(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,s.jsx)("option",{value:"",children:ed("admin.filter.all_roles")}),(0,s.jsx)("option",{value:"user",children:ed("admin.user_edit.role.user")}),(0,s.jsx)("option",{value:"admin",children:ed("profile.role.admin")})]})]}),(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 text-left",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.user")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.email")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.role")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:"Тариф"}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.registered")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.status")}),(0,s.jsx)("th",{className:"px-4 py-3"})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-100",children:nE?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:ed("common.loading")})}):0===eb.length?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:"—"})}):eb.map(e=>{var t,a;return(0,s.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,s.jsx)("td",{className:"px-4 py-3 font-medium text-gray-800",children:(0,m.H)(e.firstName,e.lastName,e.name)}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500",children:e.email}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat("admin"===e.role?"bg-red-100 text-red-700":"specialist"===e.role?"bg-green-100 text-green-700":"bg-gray-100 text-gray-600"),children:ed("profile.role.".concat(e.role))||e.role})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-400 text-xs",children:e.planId?null!=(a=null==(t=aK.find(t=>t.id===e.planId))?void 0:t.name)?a:(0,s.jsxs)("span",{className:"font-mono",children:[e.planId.slice(0,8),"…"]}):(0,s.jsx)("span",{className:"text-gray-300",children:"—"})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-400",children:new Date(e.createdAt).toLocaleDateString(rs)}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat(!1!==e.isActive?"bg-green-100 text-green-700":"bg-red-100 text-red-600"),children:!1!==e.isActive?ed("admin.users.active"):ed("admin.users.inactive")})}),(0,s.jsx)("td",{className:"px-4 py-3 text-right",children:(0,s.jsxs)("div",{className:"flex items-center justify-end gap-1.5",children:[(0,s.jsx)("button",{onClick:()=>{aL("profile"),aA(""),aD(null),aT([]),aW({}),aP({}),aH({}),aO({}),aN({...e,topUpAmount:"",topUpDescription:"",withdrawAmount:"",withdrawDescription:""}),c.jd(e.id).then(e=>aN(t=>t&&t.id===e.id?{...e,topUpAmount:"",topUpDescription:"",withdrawAmount:"",withdrawDescription:""}:t)).catch(()=>{})},className:"text-xs px-2.5 py-1 rounded-lg font-medium bg-gray-50 text-gray-600 hover:bg-gray-100 border border-gray-200",children:(0,s.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),"admin"!==e.role&&(0,s.jsx)("button",{onClick:()=>nB(e.id,!1!==e.isActive),className:"text-xs px-3 py-1 rounded-lg font-medium ".concat(!1!==e.isActive?"bg-red-50 text-red-600 hover:bg-red-100":"bg-green-50 text-green-600 hover:bg-green-100"),children:!1!==e.isActive?ed("admin.users.deactivate"):ed("admin.users.activate")})]})})]},e.id)})})]}),(0,s.jsx)(E,{page:ey,total:ej,limit:20,onChange:ev,totalLabel:ed("admin.pagination.total")})]})]}),"balances"===em&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-3 mb-4",children:[(0,s.jsx)("input",{value:au,onChange:e=>ag(e.target.value),placeholder:ed("admin.balance.filter.user_id","Фильтр по userId"),className:"flex-1 min-w-72 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"}),(0,s.jsxs)("select",{value:ap,onChange:e=>ah(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,s.jsx)("option",{value:"",children:ed("admin.balance.filter.all","Все операции")}),(0,s.jsx)("option",{value:"topup",children:ed("admin.balance.kind.topup","Пополнение")}),(0,s.jsx)("option",{value:"plan_purchase",children:ed("admin.balance.kind.plan_purchase","Списание за тариф")}),(0,s.jsx)("option",{value:"admin_topup",children:ed("admin.balance.kind.admin_topup","Пополнение админом")}),(0,s.jsx)("option",{value:"admin_adjustment",children:ed("admin.balance.kind.admin_adjustment","Корректировка")})]})]}),(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 text-left",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.user")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.balance.col.operation","Операция")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.balance.col.amount","Сумма")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.balance.col.result","Баланс")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.balance.col.description","Описание")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.balance.col.date","Дата")})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-100",children:nE?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:ed("common.loading")})}):0===ai.length?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:ed("admin.balance.empty","Записей пока нет")})}):ai.map(e=>{let t="credit"===e.direction,a="topup"===e.kind?ed("admin.balance.kind.topup","Пополнение"):"plan_purchase"===e.kind?ed("admin.balance.kind.plan_purchase","Списание за тариф"):"admin_topup"===e.kind?ed("admin.balance.kind.admin_topup","Пополнение админом"):ed("admin.balance.kind.admin_adjustment","Корректировка");return(0,s.jsxs)("tr",{className:"hover:bg-gray-50 align-top",children:[(0,s.jsxs)("td",{className:"px-4 py-3",children:[(0,s.jsx)("div",{className:"font-medium text-gray-800",children:e.userName||"—"}),(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:e.userEmail||e.userId})]}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"inline-flex rounded-full px-2 py-0.5 text-xs font-medium ".concat(t?"bg-emerald-50 text-emerald-700":"bg-rose-50 text-rose-700"),children:a})}),(0,s.jsxs)("td",{className:"px-4 py-3 font-semibold ".concat(t?"text-emerald-700":"text-rose-700"),children:[t?"+":"-",Number(e.amount).toFixed(2)," ",e.currency]}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-600",children:(0,s.jsxs)("div",{children:[Number(e.balanceBefore).toFixed(2)," → ",Number(e.balanceAfter).toFixed(2)," ",e.currency]})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500 max-w-sm",children:e.description||"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:new Date(e.createdAt).toLocaleString(rs)})]},e.id)})})]}),(0,s.jsx)(E,{page:am,total:ad,limit:50,onChange:ax,totalLabel:ed("admin.pagination.total")})]})]}),"tasks"===em&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex gap-3 mb-4",children:[(0,s.jsxs)("form",{className:"flex gap-2 flex-1",onSubmit:e=>{e.preventDefault(),eU(eR)},children:[(0,s.jsx)("input",{value:eR,onChange:e=>eW(e.target.value),placeholder:ed("admin.tasks.search.placeholder"),className:"flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"}),(0,s.jsx)("button",{type:"submit",className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700",children:ed("tasks.search.btn")})]}),(0,s.jsxs)("select",{value:ez,onChange:e=>eP(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,s.jsx)("option",{value:"",children:ed("admin.filter.all_statuses")}),["open","in_progress","completed","cancelled","draft"].map(e=>(0,s.jsx)("option",{value:e,children:ed("task.status.".concat(e),e)},e))]})]}),(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 text-left",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.title")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.customer")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.status")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.budget")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.created")}),(0,s.jsx)("th",{className:"px-4 py-3"})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-100",children:nE?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:ed("common.loading")})}):0===eE.length?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:"—"})}):eE.map(e=>{var t,a;let l=e.task||e,n=e.customer;return(0,s.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,s.jsx)("td",{className:"px-4 py-3 font-medium text-gray-800 max-w-xs",children:(0,s.jsx)(i(),{href:"/tasks/".concat(l.id),className:"hover:text-green-600 truncate block",target:"_blank",children:"en"===ec&&l.titleEn||"ru"===ec&&l.titleRu||"uk"===ec&&l.titleUk||l.titleEl||l.title})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500 text-xs",children:null!=(t=null==n?void 0:n.name)?t:"—"}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat(null!=(a=rn[l.status])?a:"bg-gray-100 text-gray-600"),children:ed("task.status.".concat(l.status),l.status)})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500",children:l.budget?"".concat((0,x.$g)(l.budget),"€"):"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-400",children:new Date(l.createdAt).toLocaleDateString(rs)}),(0,s.jsx)("td",{className:"px-4 py-3 text-right",children:(0,s.jsxs)("div",{className:"flex gap-1.5 justify-end",children:["cancelled"!==l.status&&"completed"!==l.status&&(0,s.jsx)("button",{onClick:()=>nF(l.id),className:"text-xs px-2.5 py-1 rounded-lg font-medium bg-yellow-50 text-yellow-700 hover:bg-yellow-100",children:ed("admin.tasks.cancel")}),(0,s.jsx)("button",{onClick:()=>nH(l.id,"en"===ec&&l.titleEn||"ru"===ec&&l.titleRu||"uk"===ec&&l.titleUk||l.titleEl||l.title),className:"text-xs px-2.5 py-1 rounded-lg font-medium bg-red-50 text-red-600 hover:bg-red-100",children:ed("admin.tasks.delete")})]})})]},l.id)})})]}),(0,s.jsx)(E,{page:eM,total:eB,limit:20,onChange:eA,totalLabel:ed("admin.pagination.total")})]})]}),"categories"===em&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)("p",{className:"text-sm text-gray-500",children:ed("admin.cat.hint")}),(0,s.jsxs)("button",{onClick:()=>nG(null),className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700",children:["+ ",ed("admin.cat.add_root")]})]}),a7&&(0,s.jsxs)("div",{className:"bg-green-50 border border-green-200 rounded-xl p-5 mb-4",children:[(0,s.jsxs)("h3",{className:"font-semibold text-gray-800 mb-4",children:[a7.id?ed("admin.cat.edit"):ed("admin.cat.new"),a7.parentId&&(0,s.jsxs)("span",{className:"text-xs text-gray-400 ml-2",children:["(",ed("admin.cat.subcategory"),")"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3 mb-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.cat.slug")}),(0,s.jsx)("input",{value:a7.slug,onChange:e=>a8(t=>t&&{...t,slug:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm",placeholder:"e.g. repairs"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.cat.icon")}),(0,s.jsx)(y,{value:a7.icon,onChange:e=>a8(t=>t&&{...t,icon:e}),onUpload:nX,uploading:ss,error:sn,presets:si})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.cat.order")}),(0,s.jsx)("input",{type:"number",value:a7.order,onChange:e=>a8(t=>t&&{...t,order:Number(e.target.value)}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_el")," \uD83C\uDDEC\uD83C\uDDF7"]}),(0,s.jsx)("input",{value:a7.namesEl,onChange:e=>a8(t=>t&&{...t,namesEl:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_en")," \uD83C\uDDEC\uD83C\uDDE7"]}),(0,s.jsx)("input",{value:a7.namesEn,onChange:e=>a8(t=>t&&{...t,namesEn:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_ru")," \uD83C\uDDF7\uD83C\uDDFA"]}),(0,s.jsx)("input",{value:a7.namesRu,onChange:e=>a8(t=>t&&{...t,namesRu:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_uk")," \uD83C\uDDFA\uD83C\uDDE6"]}),(0,s.jsx)("input",{value:a7.namesUk,onChange:e=>a8(t=>t&&{...t,namesUk:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]})]}),a7.id&&(0,s.jsxs)("label",{className:"flex items-center gap-2 text-sm text-gray-700 mb-3",children:[(0,s.jsx)("input",{type:"checkbox",checked:a7.isActive,onChange:e=>a8(t=>t&&{...t,isActive:e.target.checked})}),ed("admin.cat.active")]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:nY,disabled:a9,className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:a9?ed("common.saving"):ed("common.save")}),(0,s.jsx)("button",{onClick:()=>a8(null),className:"px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-50",children:ed("common.cancel")})]})]}),(0,s.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 divide-y divide-gray-100",children:0===a3.length?(0,s.jsx)("div",{className:"px-4 py-8 text-center text-gray-400",children:ed("admin.cat.empty")}):(0,s.jsx)(C,{rows:a3,parentId:null,depth:0,locale:ec,expanded:st,onToggle:function(e){sa(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})},onEdit:function(e){var t,a,s,l,n,r,i,o,d,c,m,x,u,g,p;let h="string"==typeof e.icon?e.icon:"",b=new Set(si.map(e=>e.value)),f=h.startsWith("/category-icons/")&&!b.has(h)?"/category-icons/package.svg":h||"/category-icons/package.svg";sr(null),a8({id:e.id,parentId:null!=(n=e.parentId)?n:null,slug:e.slug,icon:f,namesEl:null!=(i=null!=(r=e.namesEl)?r:null==(t=e.names)?void 0:t.el)?i:"",namesEn:null!=(d=null!=(o=e.namesEn)?o:null==(a=e.names)?void 0:a.en)?d:"",namesRu:null!=(m=null!=(c=e.namesRu)?c:null==(s=e.names)?void 0:s.ru)?m:"",namesUk:null!=(u=null!=(x=e.namesUk)?x:null==(l=e.names)?void 0:l.uk)?u:"",order:null!=(g=e.order)?g:0,isActive:null==(p=e.isActive)||p})},onDelete:nJ,onAddChild:nG,skillsExpanded:sd,skillsCache:sm,skillsLoading:su,onToggleSkills:n$,skillForm:sp,skillSaving:sb,onOpenAddSkill:function(e){sh({catSlug:e,nameEl:"",nameEn:"",nameRu:"",nameUk:"",order:0})},onOpenEditSkill:function(e,t){var a,s,l,n,r;sh({id:e.id,catSlug:t,nameEl:null!=(a=e.nameEl)?a:"",nameEn:null!=(s=e.nameEn)?s:"",nameRu:null!=(l=e.nameRu)?l:"",nameUk:null!=(n=e.nameUk)?n:"",order:null!=(r=e.order)?r:0})},onSaveSkill:nQ,onDeleteSkill:nZ,onCancelSkillForm:()=>sh(null),onSkillFormChange:sh,t:ed})})]}),"locations"===em&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)("p",{className:"text-sm text-gray-500",children:ed("admin.loc.hint")}),(0,s.jsxs)("button",{onClick:()=>nO(null),className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700",children:["+ ",ed("admin.loc.add_city")]})]}),aZ&&(0,s.jsxs)("div",{className:"bg-green-50 border border-green-200 rounded-xl p-5 mb-4",children:[(0,s.jsxs)("h3",{className:"font-semibold text-gray-800 mb-4",children:[aZ.id?ed("admin.loc.edit"):ed("admin.loc.new"),aZ.parentId&&(0,s.jsxs)("span",{className:"text-xs text-gray-400 ml-2",children:["(",ed("admin.loc.district"),")"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.cat.slug")}),(0,s.jsx)("input",{value:aZ.slug,onChange:e=>a0(t=>t&&{...t,slug:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm",placeholder:"e.g. athens-center"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_el")," \uD83C\uDDEC\uD83C\uDDF7"]}),(0,s.jsx)("input",{value:aZ.nameEl,onChange:e=>a0(t=>t&&{...t,nameEl:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_en")," \uD83C\uDDEC\uD83C\uDDE7"]}),(0,s.jsx)("input",{value:aZ.nameEn,onChange:e=>a0(t=>t&&{...t,nameEn:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_ru")," \uD83C\uDDF7\uD83C\uDDFA"]}),(0,s.jsx)("input",{value:aZ.nameRu,onChange:e=>a0(t=>t&&{...t,nameRu:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_uk")," \uD83C\uDDFA\uD83C\uDDE6"]}),(0,s.jsx)("input",{value:aZ.nameUk,onChange:e=>a0(t=>t&&{...t,nameUk:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-4 mb-3",children:[(0,s.jsxs)("div",{className:"w-24",children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.cat.order")}),(0,s.jsx)("input",{type:"number",value:aZ.order,onChange:e=>a0(t=>t&&{...t,order:Number(e.target.value)}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),aZ.id&&(0,s.jsxs)("label",{className:"flex items-center gap-2 text-sm text-gray-700 mt-4",children:[(0,s.jsx)("input",{type:"checkbox",checked:aZ.isActive,onChange:e=>a0(t=>t&&{...t,isActive:e.target.checked})}),ed("admin.cat.active")]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:nK,disabled:a1,className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:a1?ed("common.saving"):ed("common.save")}),(0,s.jsx)("button",{onClick:()=>a0(null),className:"px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-50",children:ed("common.cancel")})]})]}),(0,s.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 divide-y divide-gray-100",children:0===a$.length?(0,s.jsx)("div",{className:"px-4 py-8 text-center text-gray-400",children:ed("admin.loc.empty")}):(0,s.jsx)(w,{rows:a$,parentId:null,depth:0,locale:ec,expanded:a4,onToggle:function(e){a5(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})},onEdit:function(e){var t,a,s,l,n,r,i,o,d,c,m,x,u,g,p;a0({id:e.id,parentId:null!=(n=e.parentId)?n:null,slug:e.slug,nameEl:null!=(i=null!=(r=e.nameEl)?r:null==(t=e.names)?void 0:t.el)?i:"",nameEn:null!=(d=null!=(o=e.nameEn)?o:null==(a=e.names)?void 0:a.en)?d:"",nameRu:null!=(m=null!=(c=e.nameRu)?c:null==(s=e.names)?void 0:s.ru)?m:"",nameUk:null!=(u=null!=(x=e.nameUk)?x:null==(l=e.names)?void 0:l.uk)?u:"",order:null!=(g=e.order)?g:0,isActive:null==(p=e.isActive)||p})},onDelete:nq,onAddChild:nO,t:ed})})]}),"reports"===em&&(0,s.jsxs)("div",{className:"space-y-3",children:[nE?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("common.loading")}):0===eF.length?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("admin.reports.none")}):eF.map(e=>{var t,a,l;return(0,s.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap mb-2",children:[(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat(null!=(a=rr[e.status])?a:"bg-gray-100 text-gray-500"),children:e.status}),(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat(null!=(l=ri[e.reason])?l:"bg-gray-100 text-gray-600"),children:e.reason}),(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:["task"===e.targetType?ed("admin.reports.target.task"):ed("admin.reports.target.user"),":"," ",e.targetTitle?(0,s.jsx)(i(),{href:"task"===e.targetType?"/tasks/".concat(e.targetId):"/users/".concat(e.targetId),className:"text-green-600 hover:underline font-medium",target:"_blank",children:e.targetTitle}):(0,s.jsxs)("span",{className:"font-mono",children:["#",null==(t=e.targetId)?void 0:t.slice(0,8)]})]})]}),e.reporterName&&(0,s.jsxs)("p",{className:"text-xs text-gray-400 mb-1",children:[ed("admin.col.reporter"),": ",(0,s.jsx)("span",{className:"font-medium text-gray-600",children:e.reporterName})]}),e.description&&(0,s.jsx)("p",{className:"text-sm text-gray-700",children:e.description}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-1.5",children:new Date(e.createdAt).toLocaleString(rs)})]}),"pending"===e.status&&(0,s.jsxs)("div",{className:"flex gap-2 flex-shrink-0",children:[(0,s.jsx)("button",{onClick:()=>nV(e.id,"reviewed"),className:"text-xs px-3 py-1.5 rounded-lg font-medium bg-green-50 text-green-700 hover:bg-green-100",children:ed("admin.reports.reviewed")}),(0,s.jsx)("button",{onClick:()=>nV(e.id,"dismissed"),className:"text-xs px-3 py-1.5 rounded-lg font-medium bg-gray-100 text-gray-600 hover:bg-gray-200",children:ed("admin.reports.dismiss")})]})]})},e.id)}),(0,s.jsx)(E,{page:eV,total:eK,limit:20,onChange:eO,totalLabel:ed("admin.pagination.total")})]}),"moderation"===em&&(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,s.jsx)("div",{className:"text-sm text-gray-500",children:ed("admin.moderation.pending_count","Pending")}),(0,s.jsx)("div",{className:"text-3xl font-bold text-gray-900 mt-1",children:ro.length}),(0,s.jsx)("div",{className:"text-xs text-gray-400 mt-1",children:ed("admin.moderation.pending_hint","New proposals waiting for approval")})]}),(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,s.jsx)("div",{className:"text-sm text-gray-500",children:ed("admin.moderation.active_count","Active")}),(0,s.jsx)("div",{className:"text-3xl font-bold text-gray-900 mt-1",children:rd.length}),(0,s.jsx)("div",{className:"text-xs text-gray-400 mt-1",children:ed("admin.moderation.active_hint","Visible cards that can be blocked")})]})]}),e1?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("common.loading")}):0===eY.length?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("admin.moderation.none","No specialist cards found")}):(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800 mb-3",children:ed("admin.moderation.pending_title","Pending approval")}),(0,s.jsx)("div",{className:"space-y-3",children:0===ro.length?(0,s.jsx)("div",{className:"text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4",children:ed("admin.moderation.pending_empty","No pending proposals right now")}):ro.map(e=>{var t,a;return(0,s.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-700",children:ed("admin.moderation.pending","Pending")}),(0,s.jsx)("span",{className:"text-sm font-semibold text-gray-800 truncate",children:e.title})]}),(0,s.jsx)("div",{className:"text-xs text-gray-500 mb-2",children:null!=(a=null!=(t=e.specialistName)?t:e.specialistEmail)?a:e.specialistId}),e.description&&(0,s.jsx)("p",{className:"text-sm text-gray-700 line-clamp-3",children:e.description})]}),(0,s.jsxs)("div",{className:"flex gap-2 flex-shrink-0",children:[(0,s.jsx)("button",{onClick:()=>nP(e.id,!0),className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-green-600 text-white hover:bg-green-700",children:ed("admin.moderation.approve","Approve")}),(0,s.jsx)("button",{onClick:()=>nP(e.id,!1),className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-gray-100 text-gray-700 hover:bg-gray-200",children:ed("admin.moderation.block","Block")})]})]})},e.id)})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800 mb-3",children:ed("admin.moderation.active_title","Active cards")}),(0,s.jsx)("div",{className:"space-y-3",children:0===rd.length?(0,s.jsx)("div",{className:"text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4",children:ed("admin.moderation.active_empty","No active cards found")}):rd.map(e=>{var t,a;return(0,s.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700",children:ed("admin.moderation.active","Active")}),(0,s.jsx)("span",{className:"text-sm font-semibold text-gray-800 truncate",children:e.title})]}),(0,s.jsx)("div",{className:"text-xs text-gray-500 mb-2",children:null!=(a=null!=(t=e.specialistName)?t:e.specialistEmail)?a:e.specialistId}),e.description&&(0,s.jsx)("p",{className:"text-sm text-gray-700 line-clamp-3",children:e.description})]}),(0,s.jsx)("button",{onClick:()=>nP(e.id,!1),className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-red-50 text-red-700 hover:bg-red-100",children:ed("admin.moderation.block","Block")})]})},e.id)})})]}),(0,s.jsx)(E,{page:e$,total:eZ,limit:20,onChange:eQ,totalLabel:ed("admin.pagination.total")})]})]}),"logs"===em&&(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"flex gap-1 bg-gray-100 rounded-xl p-1 mb-5 w-fit",children:[{key:"ai",label:ed("admin.logs.subtab.ai")},{key:"activity",label:ed("admin.logs.subtab.activity")},{key:"mail",label:ed("admin.logs.subtab.mail")},{key:"notifications",label:ed("admin.logs.subtab.notifications")}].map(e=>{let{key:t,label:a}=e;return(0,s.jsx)("button",{onClick:()=>tQ(t),className:"px-4 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(t$===t?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-700"),children:a},t)})}),"ai"===t$&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsxs)("p",{className:"text-sm text-gray-500",children:[ed("admin.pagination.total"),": ",ty]}),(0,s.jsxs)("button",{onClick:()=>{tf(1),c.j_(1).then(e=>{th(e.data),tv(e.total)}).catch(()=>{})},className:"text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 flex items-center gap-1.5",children:[(0,s.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("polyline",{points:"23 4 23 10 17 10"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.49 15a9 9 0 11-2.12-9.36L23 10"})]}),ed("common.refresh")]})]}),nE?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("common.loading")}):0===tp.length?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("admin.logs.empty")}):(0,s.jsx)("div",{className:"overflow-x-auto rounded-xl border border-gray-200",children:(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 text-gray-500 text-xs uppercase",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.date")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.provider")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.model")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.action")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.langs")}),(0,s.jsx)("th",{className:"px-4 py-3 text-right",children:ed("admin.logs.in")}),(0,s.jsx)("th",{className:"px-4 py-3 text-right",children:ed("admin.logs.out")}),(0,s.jsx)("th",{className:"px-4 py-3 text-right",children:ed("admin.logs.total")}),(0,s.jsx)("th",{className:"px-4 py-3 text-right",children:ed("admin.logs.ms")}),(0,s.jsx)("th",{className:"px-4 py-3 text-center",children:ed("admin.logs.status")})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-100",children:tp.map(e=>{var t,a,l,n,r;return(0,s.jsxs)("tr",{className:"bg-white hover:bg-gray-50",children:[(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:new Date(e.createdAt).toLocaleString(rs)}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat("anthropic"===e.provider?"bg-purple-100 text-purple-700":"bg-green-100 text-green-700"),children:e.provider})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-600 font-mono text-xs",children:e.model}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-600",children:e.action}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500",children:e.fromLocale&&e.toLocale?"".concat(e.fromLocale," → ").concat(e.toLocale):"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-right text-gray-600",children:null!=(t=e.inputTokens)?t:"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-right text-gray-600",children:null!=(a=e.outputTokens)?a:"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-right font-medium",children:null!=(l=e.totalTokens)?l:"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-right text-gray-500",children:null!=(n=e.durationMs)?n:"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-center",children:e.success?(0,s.jsx)("span",{className:"text-green-600 flex justify-center",children:(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("polyline",{points:"20 6 9 17 4 12"})})}):(0,s.jsx)("span",{className:"text-red-500 flex justify-center",title:null!=(r=e.error)?r:"",children:(0,s.jsxs)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})})]},e.id)})})]})}),(0,s.jsx)(E,{page:tb,total:ty,limit:50,onChange:tf,totalLabel:ed("admin.pagination.total")})]}),"activity"===t$&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.activity.event")}),(0,s.jsxs)("select",{value:tS,onChange:e=>tL(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[180px]",children:[(0,s.jsx)("option",{value:"",children:ed("admin.activity.all_events")}),tI.map(e=>(0,s.jsx)("option",{value:e,children:e},e))]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.activity.from")}),(0,s.jsx)("input",{type:"date",value:tM,onChange:e=>tA(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.activity.to")}),(0,s.jsx)("input",{type:"date",value:tB,onChange:e=>tT(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(tS||tM||tB||tE)&&(0,s.jsxs)("button",{onClick:()=>{tL(""),tA(""),tT(""),tD("")},className:"text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-500 hover:bg-gray-200 self-end flex items-center gap-1.5",children:[(0,s.jsxs)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),ed("admin.activity.reset")]}),(0,s.jsxs)("p",{className:"text-xs text-gray-400 self-end ml-auto",children:[ed("admin.activity.total"),": ",tk]})]}),0===tj.length?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("admin.activity.empty")}):(0,s.jsx)("div",{className:"space-y-2",children:tj.map(e=>(0,s.jsx)(A,{entry:e,dateLocale:rs,onFilterUser:e=>{tD(e),tL("")},t:ed},e.id))}),(0,s.jsx)(E,{page:tC,total:tk,limit:50,onChange:t_,totalLabel:ed("admin.pagination.total")})]}),"mail"===t$&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.mail.event")}),(0,s.jsxs)("select",{value:tV,onChange:e=>tO(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]",children:[(0,s.jsx)("option",{value:"",children:ed("admin.mail.all_events")}),tY.map(e=>(0,s.jsx)("option",{value:e,children:ed("admin.event.".concat(e.replace(/\./g,"_")),e)},e))]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.mail.from")}),(0,s.jsx)("input",{type:"date",value:tK,onChange:e=>tq(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.mail.to")}),(0,s.jsx)("input",{type:"date",value:tG,onChange:e=>tX(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(tV||tK||tG)&&(0,s.jsxs)("button",{onClick:()=>{tO(""),tq(""),tX("")},className:"text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-500 hover:bg-gray-200 self-end flex items-center gap-1.5",children:[(0,s.jsxs)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),ed("admin.mail.reset")]}),(0,s.jsxs)("p",{className:"text-xs text-gray-400 self-end ml-auto",children:[ed("admin.mail.total"),": ",tz]})]}),0===tR.length?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("admin.mail.empty")}):(0,s.jsx)("div",{className:"overflow-x-auto rounded-xl border border-gray-200",children:(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 text-gray-500 text-xs uppercase",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.date")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.mail.recipient")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.mail.event")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.mail.provider")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.mail.details")}),(0,s.jsx)("th",{className:"px-4 py-3 text-center",children:ed("admin.mail.status")})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-100",children:tR.map(e=>{let t=D(e.details),a="string"==typeof(null==t?void 0:t.provider)?t.provider:"—",l="string"==typeof(null==t?void 0:t.to)?t.to:e.userEmail||"—",n="string"==typeof(null==t?void 0:t.subject)?t.subject:"",r="string"==typeof(null==t?void 0:t.error)?t.error:"",i="email.sent"===e.event||"admin.email.test.sent"===e.event;return(0,s.jsxs)("tr",{className:"bg-white hover:bg-gray-50 align-top",children:[(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:new Date(e.createdAt).toLocaleString(rs)}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-700",children:l}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-sky-50 text-sky-700",children:ed("admin.event.".concat(e.event.replace(/\./g,"_")),e.event)})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-600",children:a}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-600 max-w-md",children:(0,s.jsx)("div",{className:"truncate",title:n||r||void 0,children:n||r||"—"})}),(0,s.jsx)("td",{className:"px-4 py-3 text-center",children:i?(0,s.jsx)("span",{className:"text-green-600 inline-flex justify-center",title:ed("admin.mail.success"),children:(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("polyline",{points:"20 6 9 17 4 12"})})}):(0,s.jsx)("span",{className:"text-red-500 inline-flex justify-center",title:r||ed("admin.mail.failed"),children:(0,s.jsxs)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})})]},e.id)})})]})}),(0,s.jsx)(E,{page:tF,total:tz,limit:50,onChange:tH,totalLabel:ed("admin.pagination.total")})]}),"notifications"===t$&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.notif_logs.type")}),(0,s.jsxs)("select",{value:t3,onChange:e=>t6(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]",children:[(0,s.jsx)("option",{value:"",children:ed("admin.filter.all")}),t7.map(e=>(0,s.jsx)("option",{value:e,children:e},e))]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.activity.from")}),(0,s.jsx)("input",{type:"date",value:t9,onChange:e=>ae(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.activity.to")}),(0,s.jsx)("input",{type:"date",value:at,onChange:e=>aa(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(t3||t9||at)&&(0,s.jsxs)("button",{onClick:()=>{t6(""),ae(""),aa("")},className:"text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-500 hover:bg-gray-200 self-end flex items-center gap-1.5",children:[(0,s.jsxs)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),ed("admin.activity.reset")]}),(0,s.jsxs)("p",{className:"text-xs text-gray-400 self-end ml-auto",children:[ed("admin.pagination.total"),": ",t4]})]}),0===tZ.length?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("admin.notif_logs.empty")}):(0,s.jsx)("div",{className:"overflow-x-auto rounded-xl border border-gray-200",children:(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 text-gray-500 text-xs uppercase",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.date")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.col.user")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.notif_logs.type")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.notif_logs.title")}),(0,s.jsx)("th",{className:"px-4 py-3 text-center",children:ed("admin.notif_logs.read")})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-100",children:tZ.map(e=>{var t,a;return(0,s.jsxs)("tr",{className:"bg-white hover:bg-gray-50",children:[(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:new Date(e.createdAt).toLocaleString(rs)}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-700",children:null!=(a=null!=(t=e.recipientName)?t:e.recipientEmail)?a:e.recipientId}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-green-50 text-green-700",children:e.type})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-600 max-w-xs truncate",children:e.title}),(0,s.jsx)("td",{className:"px-4 py-3 text-center",children:e.isRead?(0,s.jsx)("span",{className:"text-green-600 flex justify-center",children:(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("polyline",{points:"20 6 9 17 4 12"})})}):(0,s.jsx)("span",{className:"text-gray-400 flex justify-center",children:(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"})})})})]},e.id)})})]})}),(0,s.jsx)(E,{page:t1,total:t4,limit:50,onChange:t2,totalLabel:ed("admin.pagination.total")})]})]}),"plans"===em&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("h2",{className:"text-lg font-semibold text-gray-800 flex items-center gap-2",children:[(0,s.jsxs)("svg",{className:"w-5 h-5 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[(0,s.jsx)("rect",{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2"}),(0,s.jsx)("line",{x1:"1",y1:"10",x2:"23",y2:"10"})]}),ed("admin.plans.title")]}),(0,s.jsx)("button",{onClick:function(){aX({name:"",description:"",role:"customer",tier:"free",price:"0",oldPrice:"",currency:"EUR",maxTasks:"",maxOffers:"",maxCards:"",maxMessagesPerDay:"",maxOrdersPerDay:"",maxSkills:"",durationDays:"",searchBoost:0,offersMultiplier:"1.00",features:"",isDefault:!1,isActive:!0,order:0,notifyNewTasks:!1,canContactFreePlan:!1,canContactProPlan:!0,canContactAll:!1,canShowContactInfo:!1,canViewPhone:!1,canUploadVideo:!1,hasFavorites:!1,hasGoogleCalendar:!1,hasVerifiedBadge:!1,highlightedReviews:!1,hasPersonalSite:!1,hasCanHelpNowStatus:!1,hasNeedHelpStatus:!1,hasAutoResponse:!1,hasAutoMatch:!1,hasPriceList:!1,receiveInstantDispatchFree:!1,receiveInstantDispatchPro:!1})},className:"bg-green-600 text-white text-sm px-4 py-2 rounded-lg hover:bg-green-700 font-medium",children:ed("admin.plans.add")})]}),aG&&(0,s.jsxs)("div",{className:"bg-white border border-gray-200 rounded-xl p-5 mb-4 space-y-3",children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800",children:aG.id?ed("admin.plans.form.edit"):ed("admin.plans.form.new")}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.name")}),(0,s.jsx)("input",{value:aG.name,onChange:e=>aX({...aG,name:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.price")}),(0,s.jsx)("input",{type:"number",min:"0",step:"0.01",value:aG.price,onChange:e=>aX({...aG,price:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.old_price")}),(0,s.jsx)("input",{type:"number",min:"0",step:"0.01",value:null!=(r=aG.oldPrice)?r:"",onChange:e=>aX({...aG,oldPrice:e.target.value}),placeholder:"—",className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.tier")}),(0,s.jsxs)("select",{value:aG.tier,onChange:e=>aX({...aG,tier:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",children:[(0,s.jsx)("option",{value:"free",children:ed("admin.plans.form.tier.free")}),(0,s.jsx)("option",{value:"pro",children:ed("admin.plans.form.tier.pro")}),(0,s.jsx)("option",{value:"ultimate",children:ed("admin.plans.form.tier.ultimate")})]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.description")}),(0,s.jsx)("input",{value:aG.description,onChange:e=>aX({...aG,description:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:ed("admin.plans.form.section.limits")}),(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.max_tasks")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aG.maxTasks,onChange:e=>aX({...aG,maxTasks:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.max_offers")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aG.maxOffers,onChange:e=>aX({...aG,maxOffers:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.max_cards")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aG.maxCards,onChange:e=>aX({...aG,maxCards:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.max_messages_day")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aG.maxMessagesPerDay,onChange:e=>aX({...aG,maxMessagesPerDay:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.max_orders_day")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aG.maxOrdersPerDay,onChange:e=>aX({...aG,maxOrdersPerDay:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.max_skills")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aG.maxSkills,onChange:e=>aX({...aG,maxSkills:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.duration_days")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aG.durationDays,onChange:e=>aX({...aG,durationDays:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]})]}),(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:ed("admin.plans.form.section.boost")}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.search_boost")}),(0,s.jsx)("input",{type:"number",min:"0",value:aG.searchBoost,onChange:e=>aX({...aG,searchBoost:Number(e.target.value)}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.offers_multiplier")}),(0,s.jsx)("input",{type:"number",min:"0",step:"0.01",value:aG.offersMultiplier,onChange:e=>aX({...aG,offersMultiplier:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.features")}),(0,s.jsx)("textarea",{rows:3,value:aG.features,onChange:e=>aX({...aG,features:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none"})]}),(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:ed("admin.plans.form.section.contact")}),(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2",children:[["canContactFreePlan",ed("admin.plans.form.can_contact_free")],["canContactProPlan",ed("admin.plans.form.can_contact_pro")],["canContactAll",ed("admin.plans.form.can_contact_all")],["canShowContactInfo",ed("admin.plans.form.can_show_contact")],["canViewPhone",ed("admin.plans.form.can_view_phone")]].map(e=>{let[t,a]=e;return(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,s.jsx)("input",{type:"checkbox",checked:aG[t],onChange:e=>aX({...aG,[t]:e.target.checked}),className:"w-4 h-4 rounded text-green-600"}),a]},t)})}),(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:ed("admin.plans.form.section.features")}),(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2",children:[["notifyNewTasks",ed("admin.plans.form.notify")],["canUploadVideo",ed("admin.plans.form.upload_video")],["hasFavorites",ed("admin.plans.form.favorites")],["hasGoogleCalendar",ed("admin.plans.form.google_calendar")],["hasVerifiedBadge",ed("admin.plans.form.verified_badge")],["highlightedReviews",ed("admin.plans.form.highlighted_reviews")],["hasPersonalSite",ed("admin.plans.form.personal_site")],["hasCanHelpNowStatus",ed("admin.plans.form.can_help_now")],["hasNeedHelpStatus",ed("admin.plans.form.need_help")],["hasAutoResponse",ed("admin.plans.form.auto_response")],["hasAutoMatch",ed("admin.plans.form.auto_match")],["hasPriceList",ed("admin.plans.form.price_list")],["receiveInstantDispatchFree",ed("admin.plans.form.instant_dispatch_free")],["receiveInstantDispatchPro",ed("admin.plans.form.instant_dispatch_pro")]].map(e=>{let[t,a]=e;return(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,s.jsx)("input",{type:"checkbox",checked:aG[t],onChange:e=>aX({...aG,[t]:e.target.checked}),className:"w-4 h-4 rounded text-green-600"}),a]},t)})}),(0,s.jsxs)("div",{className:"flex items-center gap-6 pt-1",children:[(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,s.jsx)("input",{type:"checkbox",checked:aG.isDefault,onChange:e=>aX({...aG,isDefault:e.target.checked}),className:"w-4 h-4 rounded text-green-600"}),ed("admin.plans.form.default")]}),(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,s.jsx)("input",{type:"checkbox",checked:aG.isActive,onChange:e=>aX({...aG,isActive:e.target.checked}),className:"w-4 h-4 rounded text-green-600"}),ed("admin.plans.form.active")]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("label",{className:"text-xs text-gray-600",children:ed("admin.plans.form.order")}),(0,s.jsx)("input",{type:"number",value:aG.order,onChange:e=>aX({...aG,order:Number(e.target.value)}),className:"w-16 border border-gray-300 rounded-lg px-2 py-1 text-sm focus:outline-none"})]})]}),(0,s.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,s.jsx)("button",{onClick:n0,disabled:aY||!aG.name,className:"bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:aY?"...":ed("common.save")}),(0,s.jsx)("button",{onClick:()=>aX(null),className:"px-4 py-2 rounded-lg text-sm font-medium text-gray-600 hover:bg-gray-100",children:ed("common.cancel")})]})]}),(0,s.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:0===aK.length?(0,s.jsx)("div",{className:"px-4 py-8 text-center text-gray-400 text-sm",children:ed("admin.plans.empty")}):(0,s.jsx)("div",{className:"divide-y divide-gray-100",children:aK.sort((e,t)=>{var a,s;return(null!=(a=e.order)?a:0)-(null!=(s=t.order)?s:0)}).map(e=>{var t;return(0,s.jsxs)("div",{className:"flex items-start gap-4 px-4 py-4 ".concat(e.isActive?"":"opacity-50"),children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("span",{className:"font-semibold text-gray-900",children:e.name}),e.isDefault&&(0,s.jsx)("span",{className:"bg-green-100 text-green-700 text-xs px-2 py-0.5 rounded-full font-medium",children:ed("admin.plans.badge.default")}),!e.isActive&&(0,s.jsx)("span",{className:"bg-gray-100 text-gray-500 text-xs px-2 py-0.5 rounded-full",children:ed("admin.plans.badge.inactive")})]}),e.description&&(0,s.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:e.description}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3 mt-1 text-xs text-gray-500",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5 font-semibold text-gray-800",children:[e.oldPrice&&(0,s.jsxs)("span",{className:"font-normal text-gray-400 line-through",children:[e.oldPrice," ",e.currency]}),(0,s.jsxs)("span",{children:[e.price," ",e.currency]})]}),null!=e.maxTasks&&(0,s.jsxs)("span",{children:[ed("admin.plans.tasks"),": ",e.maxTasks]}),null!=e.maxOffers&&(0,s.jsxs)("span",{children:[ed("admin.plans.offers"),": ",e.maxOffers]}),null!=e.maxCards&&(0,s.jsxs)("span",{children:[ed("admin.plans.cards"),": ",e.maxCards]}),e.notifyNewTasks&&(0,s.jsxs)("span",{className:"text-green-700 flex items-center gap-1",children:[(0,s.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),ed("admin.plans.notify_tasks")]})]}),(null!=(t=e.features)?t:[]).length>0&&(0,s.jsx)("ul",{className:"mt-1.5 space-y-0.5",children:e.features.map((e,t)=>(0,s.jsxs)("li",{className:"text-xs text-gray-600 flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-green-500",children:(0,s.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("polyline",{points:"20 6 9 17 4 12"})})})," ",e]},t))})]}),(0,s.jsxs)("div",{className:"flex gap-1 shrink-0",children:[!e.isDefault&&(0,s.jsx)("button",{onClick:()=>c.td(e.id,{isDefault:!0}).then(()=>c.OX().then(aq)).catch(()=>{}),className:"text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium",title:ed("admin.plans.make_default"),children:(0,s.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})})}),(0,s.jsx)("button",{onClick:()=>{var t,a,s,l,n,r,i,o,d,c,m,x,u,g,p,h,b,f,y,v,j,N,k,w,C,_,S,L,E,D,M;aX({id:e.id,name:e.name,description:null!=(t=e.description)?t:"",role:null!=(a=e.role)?a:"customer",tier:null!=(s=e.tier)?s:"free",price:null!=(l=e.price)?l:"0",oldPrice:null!=(n=e.oldPrice)?n:"",currency:null!=(r=e.currency)?r:"EUR",maxTasks:null!=e.maxTasks?String(e.maxTasks):"",maxOffers:null!=e.maxOffers?String(e.maxOffers):"",maxCards:null!=e.maxCards?String(e.maxCards):"",maxMessagesPerDay:null!=e.maxMessagesPerDay?String(e.maxMessagesPerDay):"",maxOrdersPerDay:null!=e.maxOrdersPerDay?String(e.maxOrdersPerDay):"",maxSkills:null!=e.maxSkills?String(e.maxSkills):"",durationDays:null!=e.durationDays?String(e.durationDays):"",searchBoost:null!=(i=e.searchBoost)?i:0,offersMultiplier:null!=(o=e.offersMultiplier)?o:"1.00",features:(null!=(d=e.features)?d:[]).join("\n"),isDefault:null!=(c=e.isDefault)&&c,isActive:null==(m=e.isActive)||m,order:null!=(x=e.order)?x:0,notifyNewTasks:null!=(u=e.notifyNewTasks)&&u,canContactFreePlan:null!=(g=e.canContactFreePlan)&&g,canContactProPlan:null==(p=e.canContactProPlan)||p,canContactAll:null!=(h=e.canContactAll)&&h,canShowContactInfo:null!=(b=e.canShowContactInfo)&&b,canViewPhone:null!=(f=e.canViewPhone)&&f,canUploadVideo:null!=(y=e.canUploadVideo)&&y,hasFavorites:null!=(v=e.hasFavorites)&&v,hasGoogleCalendar:null!=(j=e.hasGoogleCalendar)&&j,hasVerifiedBadge:null!=(N=e.hasVerifiedBadge)&&N,highlightedReviews:null!=(k=e.highlightedReviews)&&k,hasPersonalSite:null!=(w=e.hasPersonalSite)&&w,hasCanHelpNowStatus:null!=(C=e.hasCanHelpNowStatus)&&C,hasNeedHelpStatus:null!=(_=e.hasNeedHelpStatus)&&_,hasAutoResponse:null!=(S=e.hasAutoResponse)&&S,hasAutoMatch:null!=(L=e.hasAutoMatch)&&L,hasPriceList:null!=(E=e.hasPriceList)&&E,receiveInstantDispatchFree:null!=(D=e.receiveInstantDispatchFree)&&D,receiveInstantDispatchPro:null!=(M=e.receiveInstantDispatchPro)&&M})},className:"text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium",children:ed("common.edit")}),(0,s.jsx)("button",{onClick:()=>n1(e.id,e.name),className:"text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium",children:ed("common.delete")})]})]},e.id)})})})]}),"settings"===em&&(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"flex gap-1 mb-6 bg-white rounded-xl border border-gray-200 p-1 w-fit",children:["general","smtp","notifications","payment","referral","seo","socials","telegram"].map(e=>{let t={general:ed("admin.settings.tab.general"),smtp:ed("admin.settings.tab.smtp"),notifications:ed("admin.settings.tab.notifications"),payment:ed("admin.settings.tab.payment"),referral:ed("admin.settings.tab.referral"),seo:ed("admin.settings.tab.seo"),socials:ed("admin.settings.tab.socials"),telegram:ed("admin.settings.tab.telegram")};return(0,s.jsx)("button",{onClick:()=>sv(e),className:"px-4 py-2 rounded-lg text-sm font-medium transition ".concat(sy===e?"bg-green-600 text-white shadow-sm":"text-gray-600 hover:bg-gray-100"),children:t[e]},e)})}),"general"===sy&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg",children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800 mb-5",children:ed("admin.settings.general.title")}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.general.site_name")}),(0,s.jsx)("input",{value:sj.siteName,onChange:e=>sN(t=>({...t,siteName:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"CanHelp"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.general.site_url")}),(0,s.jsx)("input",{value:sj.siteUrl,onChange:e=>sN(t=>({...t,siteUrl:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"https://canhelp.com"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.general.contact_email")}),(0,s.jsx)("input",{type:"email",value:sj.contactEmail,onChange:e=>sN(t=>({...t,contactEmail:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"contact@canhelp.com"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.general.support_phone")}),(0,s.jsx)("input",{value:sj.supportPhone,onChange:e=>sN(t=>({...t,supportPhone:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"+30 21 000 0000"})]}),(0,s.jsx)("button",{onClick:n2,disabled:sk,className:"w-full py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50 transition",children:sk?ed("admin.settings.saving"):sC?ed("admin.settings.saved"):ed("common.save")})]})]}),"smtp"===sy&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg",children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800 mb-1",children:ed("admin.settings.smtp.title")}),(0,s.jsx)("p",{className:"text-sm text-gray-400 mb-5",children:ed("admin.settings.smtp.hint")}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,s.jsxs)("div",{className:"col-span-2",children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.host")}),(0,s.jsx)("input",{value:sS.host,onChange:e=>sL(t=>({...t,host:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"smtp.gmail.com"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.port")}),(0,s.jsx)("input",{value:sS.port,onChange:e=>sL(t=>({...t,port:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"587"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.encryption")}),(0,s.jsxs)("select",{value:sS.encryption,onChange:e=>sL(t=>({...t,encryption:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",children:[(0,s.jsx)("option",{value:"none",children:ed("admin.settings.smtp.enc.none")}),(0,s.jsx)("option",{value:"tls",children:"STARTTLS (587)"}),(0,s.jsx)("option",{value:"ssl",children:"SSL/TLS (465)"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.username")}),(0,s.jsx)("input",{value:sS.username,onChange:e=>sL(t=>({...t,username:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"user@gmail.com",autoComplete:"off"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.password")}),(0,s.jsx)("input",{type:"password",value:sS.password,onChange:e=>sL(t=>({...t,password:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",autoComplete:"new-password",placeholder:"••••••••••••"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.from_name")}),(0,s.jsx)("input",{value:sS.fromName,onChange:e=>sL(t=>({...t,fromName:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"CanHelp"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.from_email")}),(0,s.jsx)("input",{type:"email",value:sS.fromEmail,onChange:e=>sL(t=>({...t,fromEmail:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"noreply@canhelp.com"})]})]}),(0,s.jsx)("button",{onClick:n4,disabled:sE,className:"w-full py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50 transition",children:sE?ed("admin.settings.saving"):sM?ed("admin.settings.saved"):ed("common.save")}),(0,s.jsx)("button",{onClick:async()=>{sT(!0),sU(null);try{let e=await c.FI();sU("✓ Отправлено на ".concat(e.to))}catch(e){sU("✗ Ошибка: ".concat(e.message))}finally{sT(!1),setTimeout(()=>sU(null),5e3)}},disabled:sB,className:"w-full py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200 disabled:opacity-50 transition",children:sB?ed("admin.settings.smtp.sending"):(0,s.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),ed("admin.settings.smtp.test")]})}),sI&&(0,s.jsx)("p",{className:"text-sm text-center font-medium ".concat(sI.startsWith("✓")?"text-green-600":"text-red-500"),children:sI})]})]}),"payment"===sy&&(0,s.jsxs)("div",{className:"space-y-6 max-w-lg",children:[(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-10 h-10 rounded-lg bg-[#003087] flex items-center justify-center text-white text-xs font-bold shrink-0",children:"PB"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800",children:"ePay — Piraeus Bank"}),(0,s.jsx)("p",{className:"text-xs text-gray-400",children:"Греческий платёжный шлюз"})]})]}),(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,s.jsx)("span",{className:"text-sm text-gray-500",children:ed("admin.settings.active")}),(0,s.jsx)("button",{type:"button",onClick:()=>sX(e=>({...e,enabled:!e.enabled})),className:"relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(sG.enabled?"bg-green-600":"bg-gray-300"),children:(0,s.jsx)("span",{className:"absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(sG.enabled?"translate-x-5":"translate-x-1")})})]})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.env.label")}),(0,s.jsxs)("select",{value:sG.environment,onChange:e=>sX(t=>({...t,environment:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,s.jsx)("option",{value:"test",children:ed("admin.settings.env.test")}),(0,s.jsx)("option",{value:"production",children:ed("admin.settings.env.prod")})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.merchant_id")}),(0,s.jsx)("input",{value:sG.merchantId,onChange:e=>sX(t=>({...t,merchantId:e.target.value})),placeholder:ed("admin.settings.merchant_id"),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"API User"}),(0,s.jsx)("input",{value:sG.apiUser,onChange:e=>sX(t=>({...t,apiUser:e.target.value})),autoComplete:"off",className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"API Password"}),(0,s.jsx)("input",{type:"password",value:sG.apiPassword,onChange:e=>sX(t=>({...t,apiPassword:e.target.value})),autoComplete:"new-password",className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Confirmation URL (webhook)"}),(0,s.jsx)("input",{value:sG.confirmationUrl,onChange:e=>sX(t=>({...t,confirmationUrl:e.target.value})),placeholder:"https://yoursite.com/api/payments/epay/confirm",className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Cancel URL"}),(0,s.jsx)("input",{value:sG.cancelUrl,onChange:e=>sX(t=>({...t,cancelUrl:e.target.value})),placeholder:"https://yoursite.com/payment/cancelled",className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 mt-5",children:[(0,s.jsx)("button",{onClick:n6,disabled:sY,className:"px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:sY?ed("admin.settings.saving"):ed("common.save")}),s$&&(0,s.jsx)("span",{className:"text-sm text-green-600",children:ed("admin.settings.saved")})]})]}),(0,s.jsxs)("div",{className:"p-3 bg-amber-50 border border-amber-200 rounded-xl text-xs text-amber-700 flex items-start gap-2",children:[(0,s.jsxs)("svg",{className:"w-4 h-4 shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,s.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,s.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),(0,s.jsx)("span",{children:ed("admin.settings.payment.hint")})]})]}),"notifications"===sy&&(0,s.jsxs)("div",{className:"space-y-3 max-w-2xl",children:[(0,s.jsxs)("div",{className:"flex items-start gap-2 mb-4 p-3 bg-green-50 border border-green-100 rounded-xl text-sm text-green-700",children:[(0,s.jsxs)("svg",{className:"w-4 h-4 shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,s.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,s.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),(0,s.jsxs)("p",{children:[ed("admin.notif.vars_hint")," ",p.map(e=>{let t="{{".concat(e,"}}");return(0,s.jsx)("code",{className:"mx-0.5 bg-green-100 text-gray-800 px-1.5 py-0.5 rounded text-xs font-mono",children:t},t)})]})]}),[{key:"email_verification",label:ed("admin.notif.email_verification"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-gray-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})},{key:"registration_success",label:ed("admin.notif.registration_success"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-green-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})},{key:"password_reset",label:ed("admin.notif.password_reset"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-amber-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})})},{key:"new_offer",label:ed("admin.notif.new_offer"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-purple-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})})},{key:"new_task",label:ed("admin.notif.new_task"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-indigo-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})})},{key:"offer_accepted",label:ed("admin.notif.offer_accepted"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-green-600 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})},{key:"new_message",label:ed("admin.notif.new_message"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-pink-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})},{key:"offer_declined",label:ed("admin.notif.offer_declined"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-red-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})})},{key:"offer_other_accepted",label:ed("admin.notif.offer_other_accepted"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-green-600 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})})},{key:"task_updated",label:ed("admin.notif.task_updated"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-gray-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})},{key:"deadline_reminder",label:ed("admin.notif.deadline_reminder"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-yellow-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})},{key:"task_archived",label:ed("admin.notif.task_archived"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-red-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8l1 12a2 2 0 002 2h8a2 2 0 002-2l1-12M10 12v6m4-6v6"})})},{key:"referral_reward",label:ed("admin.notif.referral_reward"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-emerald-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v13m0-13V6a2 2 0 112.83 2.83l-2.83 2.83zm0 0V5.5A2.5 2.5 0 119.27 8H12zm-7 4h14M5 12a2 2 0 110-4h3.586a1 1 0 01.707.293l2.414 2.414M19 12a2 2 0 110-4h-3.586a1 1 0 00-.707.293l-2.414 2.414"})})},{key:"plan_activated",label:ed("admin.email_template.plan_activated"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-gray-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})},{key:"plan_upgraded",label:ed("admin.email_template.plan_upgraded"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-green-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 10l7-7m0 0l7 7m-7-7v18"})})},{key:"plan_downgrade_scheduled",label:ed("admin.email_template.plan_downgrade_scheduled"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-orange-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})},{key:"plan_downgrade_applied",label:ed("admin.email_template.plan_downgrade_applied"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-green-600 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})},{key:"plan_renewal_reminder",label:ed("admin.email_template.plan_renewal_reminder"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-yellow-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})})},{key:"plan_insufficient_funds",label:ed("admin.email_template.plan_insufficient_funds"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-red-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}].map(e=>{var t,a,l;let{key:n,label:r,icon:i}=e,o="".concat(n,"_").concat(sF),d=null!=(a=null!=(t=sR[o])?t:sR[n])?a:{subject:"",body:""},c=sz===n,m=null!=(l=g[n])?l:[];return(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 px-5 py-4 cursor-pointer hover:bg-gray-50 select-none",onClick:()=>sP(c?null:n),children:[(0,s.jsx)("span",{className:"text-xl shrink-0",children:i}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("div",{className:"font-medium text-gray-800 text-sm",children:r}),d.subject?(0,s.jsxs)("div",{className:"text-xs text-gray-400 mt-0.5 truncate",children:[ed("admin.notif.tmpl.subject_label"),": ",d.subject]}):(0,s.jsx)("div",{className:"text-xs text-gray-300 mt-0.5 italic",children:ed("admin.notif.tmpl.not_set")})]}),(0,s.jsx)("span",{className:"text-gray-400 transition-transform ".concat(c?"rotate-90":""),children:(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("polyline",{points:"9 18 15 12 9 6"})})})]}),c&&(0,s.jsxs)("div",{className:"px-5 pb-5 border-t border-gray-100 pt-4 space-y-3",children:[(0,s.jsx)("div",{className:"flex gap-1 pb-2",children:["el","en","uk","ru"].map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>sH(e),className:"px-3 py-1 text-xs font-medium rounded-md transition-colors ".concat(sF===e?"bg-green-600 text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"),children:"el"===e?"Ελληνικά":"en"===e?"English":"uk"===e?"Українська":"Русский"},e))}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.notif.tmpl.subject_label")}),(0,s.jsx)("input",{value:d.subject,onChange:e=>sW(t=>{var a;return{...t,[o]:{...null!=(a=t[o])?a:{subject:"",body:""},subject:e.target.value}}}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.notif.tmpl.body_label")}),(0,s.jsx)("textarea",{rows:7,value:d.body,onChange:e=>sW(t=>{var a;return{...t,[o]:{...null!=(a=t[o])?a:{subject:"",body:""},body:e.target.value}}}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 font-mono resize-y",placeholder:"
Уважаемый {{userName}},
..."})]}),m.length>0&&(0,s.jsxs)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2",children:[(0,s.jsx)("div",{className:"text-xs font-medium text-amber-800 mb-1",children:ed("admin.notif.vars_hint")}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:m.map(e=>{let t="{{".concat(e,"}}");return(0,s.jsx)("code",{className:"bg-amber-100 text-amber-900 px-1.5 py-0.5 rounded text-xs font-mono",children:t},t)})})]}),(0,s.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,s.jsx)("button",{onClick:()=>n3(n),disabled:sV||sK,className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:sV?ed("admin.notif.tmpl.saving"):ed("admin.notif.tmpl.save")}),(0,s.jsxs)("button",{onClick:()=>n5(n),disabled:sV||sK,className:"px-4 py-2 bg-purple-600 text-white rounded-lg text-sm font-medium hover:bg-purple-700 disabled:opacity-50 flex items-center gap-1.5",children:[(0,s.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129"})}),sK?ed("admin.notif.tmpl.translating"):ed("admin.notif.tmpl.translate")]}),(0,s.jsx)("button",{onClick:()=>sP(null),className:"px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200",children:ed("admin.notif.tmpl.close")})]})]})]},n)})]}),"referral"===sy&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800",children:ed("admin.settings.referral.title")}),(0,s.jsx)("p",{className:"text-sm text-gray-400 mt-1",children:ed("admin.settings.referral.hint")})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-gray-700",children:ed("admin.settings.referral.enabled_label")}),(0,s.jsx)("p",{className:"text-xs text-gray-400",children:ed("admin.settings.referral.enabled_hint")})]}),(0,s.jsx)("button",{type:"button",onClick:()=>s0(e=>({...e,enabled:!e.enabled})),className:"relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(sZ.enabled?"bg-green-600":"bg-gray-300"),children:(0,s.jsx)("span",{className:"absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(sZ.enabled?"translate-x-5":"translate-x-1")})})]}),(0,s.jsxs)("div",{className:"border border-gray-100 rounded-lg p-4 space-y-4",children:[(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:ed("admin.settings.referral.shared_section")}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.referral.plan_label")}),(0,s.jsxs)("select",{value:sZ.planId,onChange:e=>s0(t=>({...t,planId:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",children:[(0,s.jsx)("option",{value:"",children:ed("admin.settings.referral.no_plan")}),aK.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:ed("admin.settings.referral.plan_hint")})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.referral.days_label")}),(0,s.jsx)("input",{type:"number",min:"1",max:"365",value:sZ.days,onChange:e=>s0(t=>({...t,days:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:ed("admin.settings.referral.days_hint")})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("button",{onClick:n7,disabled:s1,className:"px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:s1?ed("admin.settings.saving"):ed("common.save")}),s4&&(0,s.jsx)("span",{className:"text-sm text-green-600",children:ed("admin.settings.saved")})]})]}),"socials"===sy&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800 mb-1",children:ed("admin.settings.socials.title")}),(0,s.jsx)("p",{className:"text-xs text-gray-400",children:ed("admin.settings.socials.hint")})]}),[{key:"telegram",label:"Telegram",placeholder:"https://t.me/yourname",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})})},{key:"instagram",label:"Instagram",placeholder:"https://instagram.com/yourname",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838a6.162 6.162 0 1 0 0 12.324 6.162 6.162 0 0 0 0-12.324zM12 16a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm6.406-11.845a1.44 1.44 0 1 0 0 2.881 1.44 1.44 0 0 0 0-2.881z"})})},{key:"facebook",label:"Facebook",placeholder:"https://facebook.com/yourpage",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})})},{key:"twitter",label:"X (Twitter)",placeholder:"https://x.com/yourname",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})},{key:"youtube",label:"YouTube",placeholder:"https://youtube.com/@yourchannel",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"})})},{key:"tiktok",label:"TikTok",placeholder:"https://tiktok.com/@yourname",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-2.88 2.5 2.89 2.89 0 0 1-2.89-2.89 2.89 2.89 0 0 1 2.89-2.89c.28 0 .54.04.79.1V9.01a6.27 6.27 0 0 0-.79-.05 6.34 6.34 0 0 0-6.34 6.34 6.34 6.34 0 0 0 6.34 6.34 6.34 6.34 0 0 0 6.33-6.34V8.73a8.16 8.16 0 0 0 4.77 1.52V6.79a4.85 4.85 0 0 1-1-.1z"})})},{key:"whatsapp",label:"WhatsApp",placeholder:"https://wa.me/30xxxxxxxxxx",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413z"})})},{key:"viber",label:"Viber",placeholder:"viber://chat?number=30xxxxxxxxxx",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M11.398.002C8.473.028 4.414.625 2.138 4.15.2 7.044-.054 10.74.009 13.092c.064 2.352.277 4.799 1.97 6.758 1.32 1.527 3.276 2.39 5.262 2.674l.006 1.92c0 .307.368.47.592.257l2.245-2.143c.666.037 1.338.046 2.001.023 3.05-.107 6.238-.671 8.39-2.988 2.27-2.45 2.476-5.915 2.515-9.093.038-3.178-.15-6.648-2.467-9.052C18.337.606 14.323-.024 11.398.002zm.11 1.55c2.73-.023 6.267.538 8.3 2.688 1.878 2.004 2.034 5.155 2.001 8.172-.033 3.017-.245 5.967-2.069 7.944-1.792 1.943-4.607 2.44-7.265 2.533a18.35 18.35 0 0 1-2.198-.051l-.301-.028L7.8 24.51l-.004-2.463-.359-.064c-1.875-.333-3.693-1.152-4.832-2.47-1.377-1.597-1.574-3.702-1.632-5.915-.058-2.213.173-5.593 1.85-8.145C4.519 2.967 8.03 1.576 11.508 1.552zm-.082 2.19a8.79 8.79 0 0 0-2.65.399c-1.567.494-2.953 1.497-3.9 2.786C3.67 8.347 3.19 10.01 3.16 11.704c-.03 1.695.392 3.435 1.465 4.754.767.94 1.833 1.603 2.978 1.95l.004 1.232 1.197-1.143c.545.094 1.102.139 1.655.134 1.614-.015 3.27-.444 4.584-1.46 1.314-1.016 2.14-2.578 2.355-4.217.216-1.64-.017-3.369-.85-4.773-.832-1.403-2.23-2.412-3.773-2.74a8.777 8.777 0 0 0-1.459-.12zm.076 1.56c.39.003.784.049 1.165.14 1.215.27 2.319 1.066 2.975 2.17.657 1.103.843 2.518.66 3.857-.183 1.339-.826 2.596-1.87 3.408-1.044.813-2.41 1.172-3.76 1.185a10.75 10.75 0 0 1-1.675-.131l-.395-.064-1.017.97-.003-1.02-.384-.117c-1.027-.314-1.95-.925-2.574-1.693-.893-1.095-1.225-2.58-1.198-4.017.028-1.437.427-2.866 1.236-3.98.809-1.113 1.959-1.905 3.236-2.296a7.298 7.298 0 0 1 1.609-.412z"})})}].map(e=>{let{key:t,label:a,placeholder:l,icon:n}=e;return(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1 flex items-center gap-2",children:[(0,s.jsx)("span",{className:"".concat(ls[t]?"text-green-600":"text-gray-300"),children:n}),a,!ls[t]&&(0,s.jsx)("span",{className:"text-xs font-normal text-gray-400 ml-auto",children:"не заполнено"})]}),(0,s.jsx)("input",{type:"url",value:ls[t],onChange:e=>ll(a=>({...a,[t]:e.target.value})),placeholder:l,className:"w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(ls[t]?"border-green-300 bg-green-50/30":"border-gray-300")})]},t)}),(0,s.jsxs)("div",{className:"flex items-center gap-3 pt-2",children:[(0,s.jsx)("button",{onClick:n9,disabled:ln,className:"px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:ln?ed("admin.settings.saving"):ed("common.save")}),li&&(0,s.jsx)("span",{className:"text-sm text-green-600",children:ed("admin.settings.saved")})]})]}),"seo"===sy&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6",children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800",children:ed("admin.settings.seo.title")}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-gray-700",children:ed("admin.settings.seo.maintenance_label")}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:ed("admin.settings.seo.maintenance_hint")})]}),(0,s.jsx)("button",{type:"button",onClick:()=>s6(e=>({...e,maintenanceMode:!e.maintenanceMode})),className:"relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(s3.maintenanceMode?"bg-red-500":"bg-gray-300"),children:(0,s.jsx)("span",{className:"absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(s3.maintenanceMode?"translate-x-5":"translate-x-1")})})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-gray-700",children:ed("admin.settings.seo.indexing_label")}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:ed("admin.settings.seo.indexing_hint")})]}),(0,s.jsx)("button",{type:"button",onClick:()=>s6(e=>({...e,indexingEnabled:!e.indexingEnabled})),className:"relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(s3.indexingEnabled?"bg-green-600":"bg-gray-300"),children:(0,s.jsx)("span",{className:"absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(s3.indexingEnabled?"translate-x-5":"translate-x-1")})})]}),(0,s.jsx)("div",{className:"space-y-4",children:(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-sm font-medium text-gray-700 mb-2",children:[ed("admin.settings.seo.site_title_label")," / ",ed("admin.settings.seo.site_description_label")]}),(0,s.jsx)("div",{className:"flex gap-1 mb-3",children:[{code:"el",flag:"\uD83C\uDDEC\uD83C\uDDF7",label:"EL"},{code:"en",flag:"\uD83C\uDDEC\uD83C\uDDE7",label:"EN"},{code:"ru",flag:"\uD83C\uDDF7\uD83C\uDDFA",label:"RU"},{code:"uk",flag:"\uD83C\uDDFA\uD83C\uDDE6",label:"UK"}].map(e=>{let{code:t,flag:a,label:l}=e;return(0,s.jsxs)("button",{type:"button",onClick:()=>la(t),className:"flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(lt===t?"bg-green-600 text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"),children:[a," ",l]},t)})}),(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.settings.seo.site_title_label")}),(0,s.jsx)("input",{value:s3["siteTitle".concat(lt.charAt(0).toUpperCase()+lt.slice(1))],onChange:e=>s6(t=>({...t,["siteTitle".concat(lt.charAt(0).toUpperCase()+lt.slice(1))]:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 mb-3",placeholder:"el"===lt?"CanHelp — Κάθε άνθρωπος έχει κάτι να προσφέρει":"en"===lt?"CanHelp — Everyone has something valuable to offer":"ru"===lt?"CanHelp — Каждый человек может чем-то помочь":"CanHelp — Кожен має навичку, яка може допомогти іншому"}),(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.settings.seo.site_description_label")}),(0,s.jsx)("textarea",{rows:3,value:s3["siteDescription".concat(lt.charAt(0).toUpperCase()+lt.slice(1))],onChange:e=>s6(t=>({...t,["siteDescription".concat(lt.charAt(0).toUpperCase()+lt.slice(1))]:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none",placeholder:"el"===lt?"Η ελληνική πλατφόρμα για online ανάθεση εργασιών...":"en"===lt?"The Greek platform for online task delegation...":"ru"===lt?"Греческая платформа для онлайн-поиска специалистов...":"Грецька платформа для пошуку фахівців онлайн..."})]})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.seo.head_scripts_label")}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:ed("admin.settings.seo.head_scripts_hint")}),(0,s.jsx)("textarea",{rows:6,value:s3.headScripts,onChange:e=>s6(t=>({...t,headScripts:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-400 resize-y",placeholder:"\x3c!-- Google Tag Manager --\x3e\n