/opt/canhelp/apps/web/.next/cache/webpack/client-production
NameSizeModeActions
0.pack645019950644editdlrm
1.pack6228990644editdlrm
2.pack16053830644editdlrm
3.pack18294750644editdlrm
4.pack13724980644editdlrm
5.pack40780644editdlrm
6.pack18542550644editdlrm
7.pack11179260644editdlrm
8.pack38699010644editdlrm
9.pack40193500644editdlrm
10.pack10927090644editdlrm
11.pack361280644editdlrm
12.pack13004210644editdlrm
13.pack115880644editdlrm
14.pack40780644editdlrm
15.pack214033720644editdlrm
16.pack5411070644editdlrm
17.pack40780644editdlrm
18.pack2954110644editdlrm
19.pack222311380644editdlrm
20.pack2752970644editdlrm
21.pack54214750644editdlrm
index.pack34315280644editdlrm
index.pack.old34732550644editdlrm
Edit: /opt/canhelp/apps/web/.next/cache/webpack/client-production/6.pack (1854255B)
wpc#Kwebpack/lib/cache/PackFileCacheStrategyPackContentItems `@MinifierWebpackPlugin|static/chunks/app/layout-beed842a4f8606de.jsMinifierWebpackPlugin|static/chunks/app/support/page-9726385e8ab4d9e9.jsMinifierWebpackPlugin|static/KhKAZ9o9r24Q-t9ZY5EHk/_ssgManifest.jsMinifierWebpackPlugin|static/KhKAZ9o9r24Q-t9ZY5EHk/_buildManifest.jsRealContentHashPlugin|analyse|static/chunks/app/layout-beed842a4f8606de.jsRealContentHashPlugin|analyse|static/chunks/app/support/page-9726385e8ab4d9e9.jsRealContentHashPlugin|analyse|static/KhKAZ9o9r24Q-t9ZY5EHk/_ssgManifest.jsRealContentHashPlugin|analyse|static/KhKAZ9o9r24Q-t9ZY5EHk/_buildManifest.jsRealContentHashPlugin|generate|static/KhKAZ9o9r24Q-t9ZY5EHk/_buildManifest.jsMinifierWebpackPlugin|static/chunks/app/page-7e6123e39c737db4.jsMinifierWebpackPlugin|static/chunks/app/admin/page-4f1d33afb5e3d26b.jsMinifierWebpackPlugin|static/chunks/app/specialist-setup/page-e927a959aaba2f1a.jsMinifierWebpackPlugin|static/chunks/app/profile/page-3d921152dadb089a.jsMinifierWebpackPlugin|static/chunks/app/users/[id]/page-0f413a1b2c8bff78.jsMinifierWebpackPlugin|static/L5x8OYDdki4Q6zJMbJdB4/_ssgManifest.jsMinifierWebpackPlugin|static/L5x8OYDdki4Q6zJMbJdB4/_buildManifest.jsCssMinimizerPlugin|static/css/2b91bf2633529f11.cssRealContentHashPlugin|analyse|static/chunks/app/page-7e6123e39c737db4.jsRealContentHashPlugin|analyse|static/chunks/app/admin/page-4f1d33afb5e3d26b.jsRealContentHashPlugin|analyse|static/chunks/app/specialist-setup/page-e927a959aaba2f1a.jsRealContentHashPlugin|analyse|static/chunks/app/profile/page-3d921152dadb089a.jsRealContentHashPlugin|analyse|static/chunks/app/users/[id]/page-0f413a1b2c8bff78.jsRealContentHashPlugin|analyse|static/css/2b91bf2633529f11.cssRealContentHashPlugin|analyse|static/L5x8OYDdki4Q6zJMbJdB4/_ssgManifest.jsRealContentHashPlugin|analyse|static/L5x8OYDdki4Q6zJMbJdB4/_buildManifest.jsRealContentHashPlugin|generate|static/L5x8OYDdki4Q6zJMbJdB4/_buildManifest.jsMinifierWebpackPlugin|static/chunks/app/admin/page-f3aa3153d82b3c44.jsMinifierWebpackPlugin|static/wVQOhu5SX7k76tnYAgrbu/_ssgManifest.jsMinifierWebpackPlugin|static/wVQOhu5SX7k76tnYAgrbu/_buildManifest.jsRealContentHashPlugin|analyse|static/chunks/app/admin/page-f3aa3153d82b3c44.jsRealContentHashPlugin|analyse|static/wVQOhu5SX7k76tnYAgrbu/_ssgManifest.jsRealContentHashPlugin|analyse|static/wVQOhu5SX7k76tnYAgrbu/_buildManifest.jsRealContentHashPlugin|generate|static/wVQOhu5SX7k76tnYAgrbu/_buildManifest.jsMinifierWebpackPlugin|static/d58bQM3fDkqINVb5Bqgnt/_ssgManifest.jsMinifierWebpackPlugin|static/d58bQM3fDkqINVb5Bqgnt/_buildManifest.jsRealContentHashPlugin|analyse|static/d58bQM3fDkqINVb5Bqgnt/_ssgManifest.jsRealContentHashPlugin|analyse|static/d58bQM3fDkqINVb5Bqgnt/_buildManifest.jsRealContentHashPlugin|generate|static/d58bQM3fDkqINVb5Bqgnt/_buildManifest.jsMinifierWebpackPlugin|static/chunks/app/page-569c0946b6617915.jsCssMinimizerPlugin|static/css/504c5ac13c6030c0.cssRealContentHashPlugin|analyse|static/chunks/app/page-569c0946b6617915.jsRealContentHashPlugin|analyse|static/css/504c5ac13c6030c0.cssMinifierWebpackPlugin|static/chunks/1530-7bf82f2d40ecd44f.jsRealContentHashPlugin|analyse|static/chunks/1530-7bf82f2d40ecd44f.jsMinifierWebpackPlugin|static/SGoLgt2Wp5u82rTtIrlN4/_ssgManifest.jsMinifierWebpackPlugin|static/SGoLgt2Wp5u82rTtIrlN4/_buildManifest.jsRealContentHashPlugin|analyse|static/SGoLgt2Wp5u82rTtIrlN4/_ssgManifest.jsRealContentHashPlugin|analyse|static/SGoLgt2Wp5u82rTtIrlN4/_buildManifest.jsRealContentHashPlugin|generate|static/SGoLgt2Wp5u82rTtIrlN4/_buildManifest.jsMinifierWebpackPlugin|static/chunks/app/admin/page-8545761ae991ddbb.jsMinifierWebpackPlugin|static/DNtuMfjK8vfrd7SAZVjO2/_ssgManifest.jsMinifierWebpackPlugin|static/DNtuMfjK8vfrd7SAZVjO2/_buildManifest.jsRealContentHashPlugin|analyse|static/chunks/app/admin/page-8545761ae991ddbb.jsRealContentHashPlugin|analyse|static/DNtuMfjK8vfrd7SAZVjO2/_ssgManifest.jsRealContentHashPlugin|analyse|static/DNtuMfjK8vfrd7SAZVjO2/_buildManifest.jsRealContentHashPlugin|generate|static/DNtuMfjK8vfrd7SAZVjO2/_buildManifest.jsMinifierWebpackPlugin|static/chunks/app/profile/page-eaf01d9841f3fc42.jsMinifierWebpackPlugin|static/chunks/app/specialist-setup/page-dda7d3575f9c1c70.jsMinifierWebpackPlugin|static/chunks/app/users/[id]/page-14a0b697fc3c4dee.jsRealContentHashPlugin|analyse|static/chunks/app/profile/page-eaf01d9841f3fc42.jsRealContentHashPlugin|analyse|static/chunks/app/specialist-setup/page-dda7d3575f9c1c70.jsRealContentHashPlugin|analyse|static/chunks/app/users/[id]/page-14a0b697fc3c4dee.jsMinifierWebpackPlugin|static/chunks/9906-cfab5f859edf89d9.jsRealContentHashPlugin|analyse|static/chunks/9906-cfab5f859edf89d9.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([[6174],{5739:(e,s,a)=>{Promise.resolve().then(a.bind(a,9633))},7541:(e,s,a)=>{"use strict";var t=a(3041);a.o(t,"useParams")&&a.d(s,{useParams:function(){return t.useParams}}),a.o(t,"usePathname")&&a.d(s,{usePathname:function(){return t.usePathname}}),a.o(t,"useRouter")&&a.d(s,{useRouter:function(){return t.useRouter}}),a.o(t,"useSearchParams")&&a.d(s,{useSearchParams:function(){return t.useSearchParams}})},9633:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>m});var t=a(4568),r=a(9664),n=a.n(r),i=a(9906);let l="info@canhelp.gr",o={el:{title:"Υποστήριξη CanHelp",intro:"Αν χρειάζεστε βοήθεια με την εφαρμογή, στείλτε μας email ή χρησιμοποιήστε τη φόρμα επικοινωνίας μέσα στην εφαρμογή.",points:["Περιγράψτε σύντομα το πρόβλημα και, αν γίνεται, επισυνάψτε στιγμιότυπο οθόνης.","Αν το ζήτημα αφορά σύνδεση, αναφέρετε τη συσκευή και την έκδοση της εφαρμογής.","Απαντάμε συνήθως μέσα σε 1-2 εργάσιμες ημέρες."]},en:{title:"CanHelp Support",intro:"If you need help with the app, email us or use the in-app contact form.",points:["Briefly describe the issue and attach a screenshot if possible.","If it is a login problem, include your device and app version.","We usually reply within 1-2 business days."]},ru:{title:"Поддержка CanHelp",intro:"Если вам нужна помощь с приложением, напишите нам на email или используйте форму связи в приложении.",points:["Кратко опишите проблему и, если возможно, приложите скриншот.","Если проблема со входом, укажите устройство и версию приложения.","Обычно мы отвечаем в течение 1-2 рабочих дней."]},uk:{title:"Підтримка CanHelp",intro:"Якщо вам потрібна допомога з додатком, напишіть нам на email або скористайтеся формою зв’язку в додатку.",points:["Коротко опишіть проблему та, якщо можливо, додайте скріншот.","Якщо проблема зі входом, вкажіть пристрій і версію додатка.","Зазвичай ми відповідаємо протягом 1-2 робочих днів."]}};function m(){var e;let{locale:s,t:a}=(0,i.Y)(),r=null!=(e=o[s])?e:o.en;return(0,t.jsx)("main",{className:"py-12 px-4 sm:px-6",children:(0,t.jsxs)("div",{className:"max-w-3xl mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10",children:[(0,t.jsx)("div",{className:"mb-6",children:(0,t.jsxs)(n(),{href:"/",className:"text-sm text-green-600 hover:underline",children:["← ",a("nav.home")]})}),(0,t.jsx)("h1",{className:"text-3xl font-extrabold text-gray-900 mb-3",children:r.title}),(0,t.jsx)("p",{className:"text-gray-600 leading-relaxed",children:r.intro}),(0,t.jsx)("div",{className:"mt-8 space-y-3",children:r.points.map(e=>(0,t.jsxs)("div",{className:"flex gap-3 items-start rounded-xl border border-gray-100 bg-gray-50 px-4 py-3 text-sm text-gray-700",children:[(0,t.jsx)("span",{className:"mt-0.5 h-2 w-2 rounded-full bg-green-500 shrink-0"}),(0,t.jsx)("span",{children:e})]},e))}),(0,t.jsxs)("div",{className:"mt-8 flex flex-col sm:flex-row gap-3 sm:items-center",children:[(0,t.jsx)("a",{href:"mailto:".concat(l),className:"inline-flex items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 transition",children:l}),(0,t.jsx)("span",{className:"text-sm text-gray-500",children:a("nav.privacy")})]})]})})}}},e=>{e.O(0,[9664,9906,587,18,7358],()=>e(e.s=5739)),_N_E=e.O()}]); Mself.__SSG_MANIFEST=new Set,self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB(); self.__BUILD_MANIFEST=function(e,r,t,_){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},__routerFilterStatic:{numItems:30,errorRate:1e-4,numBits:576,numHashes:14,bitArray:[0,1,1,e,0,e,e,r,e,e,e,r,r,e,r,r,e,e,e,e,r,e,r,r,e,r,r,r,e,e,e,e,e,e,e,r,r,e,r,r,r,e,e,r,r,e,e,r,r,r,e,r,e,r,e,r,e,r,r,r,r,e,e,r,r,e,r,r,e,r,r,r,e,r,e,r,e,r,e,e,r,r,r,r,e,r,r,e,e,e,e,r,e,e,e,e,r,r,e,r,e,r,r,e,e,e,r,r,r,e,r,r,e,e,r,e,e,r,e,r,r,e,r,r,r,e,r,e,r,e,r,r,r,r,e,r,e,r,e,e,r,r,r,e,r,r,r,r,e,r,r,e,e,r,e,e,e,e,r,e,e,r,r,e,e,r,r,e,e,r,e,r,e,e,e,e,e,e,e,e,r,r,r,r,r,r,r,e,e,e,e,e,e,r,e,r,r,r,r,e,r,e,e,e,e,e,e,e,e,e,e,e,r,r,r,e,e,e,e,e,e,e,e,e,e,e,e,r,r,r,e,r,e,e,r,e,e,e,r,e,r,r,e,r,e,e,e,e,e,r,e,e,r,r,r,e,e,r,e,e,e,r,r,e,e,e,e,e,r,e,e,r,r,r,r,e,e,e,e,e,e,e,e,e,r,r,r,e,r,e,e,r,r,e,e,r,r,e,e,r,e,e,r,r,e,r,r,e,e,r,e,e,e,e,r,r,e,r,r,e,e,e,r,r,r,r,e,e,r,r,r,e,e,r,r,r,r,e,r,e,e,r,r,r,r,r,r,e,r,e,e,e,e,e,r,e,e,e,e,e,r,r,r,r,e,e,e,r,e,r,r,e,r,e,r,e,r,e,r,r,r,r,r,r,e,e,r,r,e,r,e,e,e,e,r,r,e,r,e,e,r,e,e,r,r,r,e,e,r,e,r,e,r,r,r,e,r,r,e,e,r,r,e,r,r,r,e,e,r,e,r,e,e,e,r,e,r,e,e,r,r,e,e,e,e,e,e,r,r,e,e,r,r,e,e,e,e,e,r,e,r,e,r,e,e,e,e,e,r,e,e,r,r,r,e,r,e,e,r,r,e,r,r,e,r,r,r,r,r,r,e,e,e,r,r,r,r,r,e,e,r,r,e,r,r,r,r,e,r,r,r,e,r,r,e,e,e,r,e,e,r,e,e,r,r,e,e,r,e,e,e,e,e,r,e,e,e,e,e,e,e,r,r,e,r,r,r,r,e,e,r,r,e,e,e,r,e,e,r,e,e,e,r,e,r,r,r,r,e,r,r,r,r,e,e,r]},__routerFilterDynamic:{numItems:3,errorRate:1e-4,numBits:58,numHashes:14,bitArray:[e,e,e,e,e,e,e,r,e,r,e,r,e,e,r,e,r,e,e,r,e,e,r,e,r,e,r,r,r,e,e,e,e,r,r,r,e,e,r,e,r,e,e,r,r,e,r,r,r,r,r,r,e,e,e,e,e,r]},"/_error":["static/chunks/pages/_error-0cf0a41ff2efd71f.js"],sortedPages:["/_app","/_error"]}}(1,0,1e-4,14),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); 0cf0a41ff2efd71fself.__BUILD_MANIFEST=function(e,r,t,_){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},__routerFilterStatic:{numItems:30,errorRate:1e-4,numBits:576,numHashes:14,bitArray:[0,1,1,e,0,e,e,r,e,e,e,r,r,e,r,r,e,e,e,e,r,e,r,r,e,r,r,r,e,e,e,e,e,e,e,r,r,e,r,r,r,e,e,r,r,e,e,r,r,r,e,r,e,r,e,r,e,r,r,r,r,e,e,r,r,e,r,r,e,r,r,r,e,r,e,r,e,r,e,e,r,r,r,r,e,r,r,e,e,e,e,r,e,e,e,e,r,r,e,r,e,r,r,e,e,e,r,r,r,e,r,r,e,e,r,e,e,r,e,r,r,e,r,r,r,e,r,e,r,e,r,r,r,r,e,r,e,r,e,e,r,r,r,e,r,r,r,r,e,r,r,e,e,r,e,e,e,e,r,e,e,r,r,e,e,r,r,e,e,r,e,r,e,e,e,e,e,e,e,e,r,r,r,r,r,r,r,e,e,e,e,e,e,r,e,r,r,r,r,e,r,e,e,e,e,e,e,e,e,e,e,e,r,r,r,e,e,e,e,e,e,e,e,e,e,e,e,r,r,r,e,r,e,e,r,e,e,e,r,e,r,r,e,r,e,e,e,e,e,r,e,e,r,r,r,e,e,r,e,e,e,r,r,e,e,e,e,e,r,e,e,r,r,r,r,e,e,e,e,e,e,e,e,e,r,r,r,e,r,e,e,r,r,e,e,r,r,e,e,r,e,e,r,r,e,r,r,e,e,r,e,e,e,e,r,r,e,r,r,e,e,e,r,r,r,r,e,e,r,r,r,e,e,r,r,r,r,e,r,e,e,r,r,r,r,r,r,e,r,e,e,e,e,e,r,e,e,e,e,e,r,r,r,r,e,e,e,r,e,r,r,e,r,e,r,e,r,e,r,r,r,r,r,r,e,e,r,r,e,r,e,e,e,e,r,r,e,r,e,e,r,e,e,r,r,r,e,e,r,e,r,e,r,r,r,e,r,r,e,e,r,r,e,r,r,r,e,e,r,e,r,e,e,e,r,e,r,e,e,r,r,e,e,e,e,e,e,r,r,e,e,r,r,e,e,e,e,e,r,e,r,e,r,e,e,e,e,e,r,e,e,r,r,r,e,r,e,e,r,r,e,r,r,e,r,r,r,r,r,r,e,e,e,r,r,r,r,r,e,e,r,r,e,r,r,r,r,e,r,r,r,e,r,r,e,e,e,r,e,e,r,e,e,r,r,e,e,r,e,e,e,e,e,r,e,e,e,e,e,e,e,r,r,e,r,r,r,r,e,e,r,r,e,e,e,r,e,e,r,e,e,e,r,e,r,r,r,r,e,r,r,r,r,e,e,r]},__routerFilterDynamic:{numItems:3,errorRate:1e-4,numBits:58,numHashes:14,bitArray:[e,e,e,e,e,e,e,r,e,r,e,r,e,e,r,e,r,e,e,r,e,e,r,e,r,e,r,r,r,e,e,e,e,r,r,r,e,e,r,e,r,e,e,r,r,e,r,r,r,r,r,r,e,e,e,e,e,r]},"/_error":["static/chunks/pages/_error-fed8688bdd23f211.js"],sortedPages:["/_app","/_error"]}}(1,0,1e-4,14),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); l1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{912:(e,t,n)=>{"use strict";n.d(t,{ShareButton:()=>l});var s=n(4568),r=n(7620);function l(e){let{label:t,copiedLabel:n}=e,[l,a]=(0,r.useState)(!1),o=async()=>{let e=window.location.origin;if(navigator.share)try{await navigator.share({url:e,title:"CanHelp"});return}catch(e){}await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2500)};return(0,s.jsx)("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 bg-amber-500 text-white px-8 py-3.5 rounded-2xl font-bold text-base hover:bg-amber-600 transition shadow-md shadow-amber-500/25 active:scale-95",children:l?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-lg",children:"✓"}),n]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-lg",children:"\uD83D\uDD17"}),t]})})}},1277:(e,t,n)=>{"use strict";n.d(t,{PromoCountdown:()=>c});var s=n(4568),r=n(7620),l=n(9664),a=n.n(l);function o(){let e=new Date,t=new Date(e.getFullYear(),11,31,23,59,59).getTime()-e.getTime();if(t<=0)return{d:0,h:0,m:0,s:0};let n=Math.floor(t/864e5),s=Math.floor(t%864e5/36e5);return{d:n,h:s,m:Math.floor(t%36e5/6e4),s:Math.floor(t%6e4/1e3)}}let i={d:0,h:0,m:0,s:0};function c(e){let{title:t,subtitle:n,cta:l,days:c,hours:d,minutes:u,seconds:m}=e,[x,h]=(0,r.useState)(i);return(0,r.useEffect)(()=>{h(o());let e=setInterval(()=>h(o()),1e3);return()=>clearInterval(e)},[]),(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-3xl shadow-2xl bg-gradient-to-br from-green-700 via-green-800 to-green-900 text-white px-6 py-10 md:px-14 md:py-14 flex flex-col items-center text-center",children:[(0,s.jsx)("div",{className:"absolute -top-16 -right-16 w-64 h-64 rounded-full bg-green-500/20 blur-3xl pointer-events-none"}),(0,s.jsx)("div",{className:"absolute -bottom-16 -left-16 w-64 h-64 rounded-full bg-green-400/20 blur-3xl pointer-events-none"}),(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 bg-green-500/90 text-white text-sm font-bold px-4 py-1.5 rounded-full mb-5 shadow-lg tracking-wide uppercase",children:[(0,s.jsx)("span",{children:"\uD83C\uDF81"})," Pro — Free"]}),(0,s.jsx)("h2",{className:"text-3xl md:text-4xl font-extrabold mb-3 tracking-tight drop-shadow-lg",children:t}),(0,s.jsx)("p",{className:"text-green-200 text-lg md:text-xl mb-8 max-w-xl font-medium",children:n}),(0,s.jsx)("div",{className:"flex items-end gap-3 md:gap-6 mb-8",children:[{value:x.d,label:c},{value:x.h,label:d},{value:x.m,label:u},{value:x.s,label:m}].map((e,t)=>(0,s.jsxs)("div",{className:"flex items-end gap-3 md:gap-6",children:[t>0&&(0,s.jsx)("span",{className:"text-3xl md:text-4xl font-extrabold text-gray-300 mb-2 leading-none select-none",children:":"}),(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(0,s.jsx)("div",{className:"bg-white/10 backdrop-blur border border-white/20 rounded-2xl w-16 md:w-20 h-16 md:h-20 flex items-center justify-center shadow-lg",children:(0,s.jsx)("span",{className:"text-3xl md:text-4xl font-extrabold tabular-nums",children:String(e.value).padStart(2,"0")})}),(0,s.jsx)("span",{className:"text-gray-300 text-xs font-semibold mt-1.5 uppercase tracking-widest",children:e.label})]})]},e.label))}),(0,s.jsx)(a(),{href:"/register",className:"btn-accent text-lg px-10 py-3 shadow-xl hover:scale-105 transition-transform duration-200",children:l})]})}},1386:(e,t,n)=>{"use strict";n.d(t,{HomeCategoryGrid:()=>o});var s=n(4568),r=n(7620),l=n(7541),a=n(5940);function o(e){var t,n;let{categories:o,locale:i,isSpecialist:c,allInLabel:d,categoryLabel:u,selectLabel:m,cancelLabel:x}=e,h=(0,l.useRouter)(),[g,p]=(0,r.useState)(null),b=(0,r.useMemo)(()=>{var e;return null!=(e=o.find(e=>e.slug===g))?e:null},[o,g]),f=null!=(t=null==b?void 0:b.children)?t:[];function v(e){h.push(c?"/tasks?category=".concat(e):"/tasks/new?category=".concat(e))}function j(){p(null)}return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-7 gap-4",children:o.map(e=>{var t,n;return(0,s.jsxs)("button",{type:"button",onClick:()=>(function(e){let t=Array.isArray(e.children)&&e.children.length>0;if(c||!t)return void v(e.slug);p(e.slug)})(e),className:"modern-card flex flex-col items-center gap-2 p-4 text-center group hover:bg-green-50/60 transition-all duration-200",children:[(0,s.jsx)(a.Ez,{icon:e.icon,alt:null!=(t=e.names[i])?t:e.names.el,className:"h-14 w-14 object-contain text-5xl sm:h-16 sm:w-16 sm:text-6xl transition-transform group-hover:scale-110 leading-none",fallback:"\uD83D\uDCE6"}),(0,s.jsx)("span",{className:"text-xs font-semibold text-gray-900 group-hover:text-green-600 transition leading-tight",children:null!=(n=e.names[i])?n:e.names.el})]},e.id)})}),b&&(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-end sm:items-center justify-center p-0 sm:p-4",children:[(0,s.jsx)("button",{type:"button",className:"absolute inset-0 bg-black/45",onClick:j,"aria-label":x}),(0,s.jsxs)("div",{className:"relative w-full sm:max-w-lg bg-white rounded-t-2xl sm:rounded-2xl shadow-2xl border border-gray-100 p-5 sm:p-6",children:[(0,s.jsx)("div",{className:"w-12 h-1.5 bg-gray-200 rounded-full mx-auto mb-4 sm:hidden"}),(0,s.jsx)("h3",{className:"text-lg font-bold text-gray-900 mb-1",children:u}),(0,s.jsx)("p",{className:"text-sm text-gray-500 mb-4",children:m}),(0,s.jsxs)("div",{className:"space-y-2 max-h-[55vh] overflow-y-auto pr-1",children:[(0,s.jsx)("button",{type:"button",onClick:()=>{v(b.slug),j()},className:"w-full text-left rounded-xl border border-green-200 bg-green-50 px-4 py-3 hover:bg-green-100 transition",children:(0,s.jsxs)("span",{className:"font-semibold text-green-700",children:[d," ",null!=(n=b.names[i])?n:b.names.el]})}),f.map(e=>{var t;return(0,s.jsx)("button",{type:"button",onClick:()=>{v(e.slug),j()},className:"w-full text-left rounded-xl border border-gray-200 bg-white px-4 py-3 hover:border-green-300 hover:bg-green-50 transition",children:(0,s.jsx)("span",{className:"font-medium text-gray-800",children:null!=(t=e.names[i])?t:e.names.el})},e.id)})]}),(0,s.jsx)("div",{className:"mt-5 flex justify-end",children:(0,s.jsx)("button",{type:"button",onClick:j,className:"px-4 py-2 rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-50",children:x})})]})]})]})}},1592:(e,t,n)=>{"use strict";n.d(t,{CI:()=>l,Hh:()=>a,Jv:()=>r,wV:()=>o,yK:()=>s});let s=(0,n(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:r,signOut:l,signUp:a,useSession:o}=s},2294:(e,t,n)=>{"use strict";n.d(t,{HomeCityCloud:()=>o});var s=n(4568),r=n(7541),l=n(4029),a=n(9906);function o(e){let{locationTree:t,isSpecialist:n=!1}=e,o=(0,r.useRouter)(),{setLocation:i}=(0,l.z)(),{locale:c}=(0,a.Y)(),d=e=>{n?o.push("/tasks?location=".concat(e)):(i(e),o.push("/tasks/new"))};return t.length?(0,s.jsx)("div",{className:"flex flex-wrap justify-center gap-3",children:t.map(e=>{var t,n;return(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>d(e.slug),className:"inline-flex items-center gap-1 px-4 py-2 rounded-full bg-indigo-100 text-indigo-700 font-semibold text-sm hover:bg-indigo-200 transition cursor-pointer",children:["\uD83D\uDCCD ",null!=(t=e.names[c])?t:e.names.el]}),(null!=(n=e.children)?n:[]).map(e=>{var t;return(0,s.jsx)("button",{type:"button",onClick:()=>d(e.slug),className:"inline-flex items-center px-3 py-1.5 rounded-full bg-slate-100 text-slate-700 text-sm hover:bg-indigo-100 hover:text-indigo-700 transition cursor-pointer",children:null!=(t=e.names[c])?t:e.names.el},e.id)})]},e.id)})}):null}},4029:(e,t,n)=>{"use strict";n.d(t,{LocationProvider:()=>o,z:()=>i});var s=n(4568),r=n(7620),l=n(2982);let a=(0,r.createContext)({locationSlug:"",locationTree:[],locationLoading:!0,setLocation:()=>{},getLabel:()=>""});function o(e){let{children:t,initialSlug:n=""}=e,[o,i]=(0,r.useState)(n),[c,d]=(0,r.useState)([]),[u,m]=(0,r.useState)(!0);(0,r.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,r.useEffect)(()=>{(0,l.Vs)().then(e=>d(e)).catch(()=>{}).finally(()=>m(!1))},[]);let x=(0,r.useCallback)(e=>{i(e);let t=encodeURIComponent(e);document.cookie="canhelp_location=".concat(t,"; path=/; max-age=31536000; SameSite=Lax")},[]),h=(0,r.useCallback)(e=>{if(!o)return"";for(let r of c){var t,n,s;if(r.slug===o)return null!=(t=r.names[e])?t:r.names.el;for(let t of null!=(n=r.children)?n:[])if(t.slug===o)return null!=(s=t.names[e])?s:t.names.el}return o},[o,c]);return(0,s.jsx)(a.Provider,{value:{locationSlug:o,locationTree:c,locationLoading:u,setLocation:x,getLabel:h},children:t})}function i(){return(0,r.useContext)(a)}},5940:(e,t,n)=>{"use strict";n.d(t,{Ez:()=>a,V:()=>l});var s=n(4568),r=n(7620);function l(e){if(!e)return!1;let t=e.trim();return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")}function a(e){let{icon:t,alt:n="",className:a,fallback:o="\uD83D\uDCE6"}=e,i=(t||"").trim(),[c,d]=(0,r.useState)(!1);(0,r.useEffect)(()=>{d(!1)},[i]);let u=(0,r.useMemo)(()=>l(i)?i.startsWith("/api/")?"".concat("https://api.canhelp.gr").concat(i):i:"",[i]),m="/category-icons/package.svg";return l(i)?c&&i!==m?(0,s.jsx)("img",{src:m,alt:n,className:a,loading:"lazy",onError:()=>d(!0)}):c&&i===m?(0,s.jsx)("span",{className:a,children:o}):(0,s.jsx)("img",{src:u,alt:n,className:a,loading:"lazy",onError:()=>d(!0)}):(0,s.jsx)("span",{className:a,children:i||o})}},6787:(e,t,n)=>{"use strict";n.d(t,{HeroSearch:()=>a});var s=n(4568),r=n(7620),l=n(7541);function a(e){let{placeholder:t,mode:n="customer"}=e,[a,o]=(0,r.useState)(""),i=(0,l.useRouter)();return(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault();let t=a.trim();"specialist"===n?t?i.push("/tasks?q=".concat(encodeURIComponent(t))):i.push("/tasks"):t?i.push("/specialists?q=".concat(encodeURIComponent(t))):i.push("/specialists")},className:"relative w-full mb-8",children:[(0,s.jsx)("input",{type:"text",value:a,onChange:e=>o(e.target.value),placeholder:t,className:"w-full pl-5 pr-14 py-3.5 rounded-2xl border border-green-200 bg-white/90 text-gray-900 placeholder:text-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-400 text-base shadow-sm"}),(0,s.jsx)("button",{type:"submit",className:"absolute right-2 top-1/2 -translate-y-1/2 bg-green-600 hover:bg-green-700 text-white p-2.5 rounded-xl transition-colors duration-200","aria-label":"Search",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})})})]})}},6811:(e,t,n)=>{"use strict";n.d(t,{BecomeSpecialistButton:()=>o});var s=n(4568),r=n(1592),l=n(7541),a=n(9906);function o(e){let{className:t}=e,{data:n,isPending:o}=(0,r.wV)(),i=(0,l.useRouter)(),{t:c}=(0,a.Y)();return(0,s.jsx)("button",{type:"button",onClick:function(){o||(n?i.push("/become-specialist"):i.push("/register"))},className:null!=t?t:"btn-outline w-full sm:w-auto text-center",children:c("hero.cta.browse")})}},7529:(e,t,n)=>{Promise.resolve().then(n.bind(n,6811)),Promise.resolve().then(n.bind(n,9869)),Promise.resolve().then(n.bind(n,6787)),Promise.resolve().then(n.bind(n,1386)),Promise.resolve().then(n.bind(n,2294)),Promise.resolve().then(n.bind(n,1277)),Promise.resolve().then(n.bind(n,912)),Promise.resolve().then(n.t.bind(n,9664,23))},9869:(e,t,n)=>{"use strict";n.d(t,{FaqAccordion:()=>l});var s=n(4568),r=n(7620);function l(e){let{items:t}=e,[n,l]=(0,r.useState)(null);return(0,s.jsx)("div",{className:"space-y-3",children:t.map((e,t)=>{let r=n===t;return(0,s.jsxs)("div",{className:"modern-card overflow-hidden transition-all duration-200",children:[(0,s.jsxs)("button",{type:"button",className:"w-full flex items-center justify-between gap-4 px-6 py-5 text-left",onClick:()=>l(r?null:t),children:[(0,s.jsx)("span",{className:"font-semibold text-gray-900 text-base leading-snug",children:e.q}),(0,s.jsx)("span",{className:"shrink-0 w-6 h-6 rounded-full bg-green-50 flex items-center justify-center transition-transform ".concat(r?"rotate-45":""),children:(0,s.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:(0,s.jsx)("path",{d:"M7 2v10M2 7h10",stroke:"#2563EB",strokeWidth:"2",strokeLinecap:"round"})})})]}),r&&(0,s.jsx)("div",{className:"px-6 pb-5 text-green-700 text-sm leading-relaxed border-t border-green-100 pt-4",children:e.a})]},t)})})}}},e=>{e.O(0,[1516,9664,9906,2982,587,18,7358],()=>e(e.s=7529)),_N_E=e.O()}]); T(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 n(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:()=>n})},1592:(e,t,a)=>{"use strict";a.d(t,{CI:()=>l,Hh:()=>r,Jv:()=>n,wV:()=>i,yK:()=>s});let s=(0,a(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:n,signOut:l,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 n(e){return null==e||""===e?"":Math.round(Number(e)).toString()}function l(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:()=>n,GZ:()=>l,Oj:()=>s})},5940:(e,t,a)=>{"use strict";a.d(t,{Ez:()=>r,V:()=>l});var s=a(4568),n=a(7620);function l(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,n.useState)(!1);(0,n.useEffect)(()=>{c(!1)},[o]);let m=(0,n.useMemo)(()=>l(o)?o.startsWith("/api/")?"".concat("https://api.canhelp.gr").concat(o):o:"",[o]),x="/category-icons/package.svg";return l(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),n=a(7620),l=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 p={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"]},g=Array.from(new Set(Object.values(p).flat())),h=[{value:"/category-icons/tools.svg",label:"Repairs & services"},{value:"/category-icons/cleaning.svg",label:"Cleaning"},{value:"/category-icons/truck.svg",label:"Moving"},{value:"/category-icons/laptop.svg",label:"IT & digital"},{value:"/category-icons/paint.svg",label:"Design"},{value:"/category-icons/beauty.svg",label:"Beauty"},{value:"/category-icons/event.svg",label:"Events"},{value:"/category-icons/camera.svg",label:"Photo & video"},{value:"/category-icons/pets.svg",label:"Pets"},{value:"/category-icons/car.svg",label:"Auto"},{value:"/category-icons/legal.svg",label:"Legal"},{value:"/category-icons/analytics.svg",label:"Accounting"},{value:"/category-icons/home.svg",label:"Home"},{value:"/category-icons/package.svg",label:"Generic"}];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:n,uploading:l,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(l?"border-gray-200 bg-gray-100 text-gray-400":"border-green-300 bg-green-50 text-green-700 hover:bg-green-100"),children:[l?"Uploading...":"Upload SVG",(0,s.jsx)("input",{type:"file",accept:".svg,image/svg+xml",className:"hidden",disabled:l,onChange:async e=>{var t;let a=null==(t=e.target.files)?void 0:t[0];a&&(await n(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 n=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(n?"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 j(e){let{catRows:t,locale:a,selected:l,onAdd:r,addLabel:i}=e,[o,d]=(0,n.useState)(!1),[c,m]=(0,n.useState)(""),[x,p]=(0,n.useState)(null),g=(0,n.useRef)(null);(0,n.useEffect)(()=>{function e(e){g.current&&!g.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: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.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 n=t.filter(t=>t.parentId===e.id),i=b(e,a),o=x===e.id,g=n.filter(e=>!l.includes(e.slug)&&y(e)),h=!l.includes(e.slug)&&y(e),f=n.length>0;return!h&&0===g.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?p(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)&&g.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 v(e){let{locRows:t,locale:a,selected:l,onAdd:r,addLabel:i}=e,[o,d]=(0,n.useState)(!1),[c,m]=(0,n.useState)(""),[x,u]=(0,n.useState)(null),p=(0,n.useRef)(null);(0,n.useEffect)(()=>{function e(e){p.current&&!p.current.contains(e.target)&&(d(!1),m(""))}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let g=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: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.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"})}),g.map(e=>{let n=t.filter(t=>t.parentId===e.id),i=f(e,a),o=x===e.id,p=n.length>0,g=n.filter(e=>!l.includes(e.slug)&&b(e)),h=!l.includes(e.slug)&&b(e);return!h&&0===g.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:()=>{p&&!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}),p&&!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)&&g.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,I,T,R,W,z,P,F,H,V,O,K,q,G,X,Y,J,$,Q,Z,ee,et,ea,es,en,el;let er=(0,l.useRouter)(),{data:ei,isPending:eo}=(0,o.wV)(),{t:ed,locale:ec}=(0,d.Y)(),[em,ex]=(0,n.useState)("stats"),[eu,ep]=(0,n.useState)(!1);(0,n.useEffect)(()=>{ep(window.innerWidth<1024)},[]);let[eg,eh]=(0,n.useState)(null),[eb,ef]=(0,n.useState)([]),[ey,ej]=(0,n.useState)(1),[ev,eN]=(0,n.useState)(0),[ek,ew]=(0,n.useState)(""),[eC,e_]=(0,n.useState)(""),[eS,eL]=(0,n.useState)(""),[eE,eD]=(0,n.useState)([]),[eM,eB]=(0,n.useState)(1),[eA,eI]=(0,n.useState)(0),[eT,eU]=(0,n.useState)(""),[eR,eW]=(0,n.useState)(""),[ez,eP]=(0,n.useState)(""),[eF,eH]=(0,n.useState)([]),[eV,eO]=(0,n.useState)(1),[eK,eq]=(0,n.useState)(0),[eG,eX]=(0,n.useState)([]),[eY,eJ]=(0,n.useState)(1),[e$,eQ]=(0,n.useState)(0),[eZ,e0]=(0,n.useState)(""),[e2,e1]=(0,n.useState)(""),[e4,e5]=(0,n.useState)(""),[e3,e6]=(0,n.useState)(""),[e7,e8]=(0,n.useState)(null),[e9,te]=(0,n.useState)(""),[tt,ta]=(0,n.useState)(!1),[ts,tn]=(0,n.useState)([]),[tl,tr]=(0,n.useState)(1),[ti,to]=(0,n.useState)(0),[td,tc]=(0,n.useState)([]),[tm,tx]=(0,n.useState)(0),[tu,tp]=(0,n.useState)(1),[tg,th]=(0,n.useState)(""),[tb,tf]=(0,n.useState)(""),[ty,tj]=(0,n.useState)(""),[tv,tN]=(0,n.useState)(""),[tk,tw]=(0,n.useState)([]),[tC,t_]=(0,n.useState)([]),[tS,tL]=(0,n.useState)(0),[tE,tD]=(0,n.useState)(1),[tM,tB]=(0,n.useState)(""),[tA,tI]=(0,n.useState)(""),[tT,tU]=(0,n.useState)(""),[tR,tW]=(0,n.useState)([]),[tz,tP]=(0,n.useState)("ai"),[tF,tH]=(0,n.useState)([]),[tV,tO]=(0,n.useState)(1),[tK,tq]=(0,n.useState)(0),[tG,tX]=(0,n.useState)(""),[tY,tJ]=(0,n.useState)([]),[t$,tQ]=(0,n.useState)(""),[tZ,t0]=(0,n.useState)(""),[t2,t1]=(0,n.useState)([]),[t4,t5]=(0,n.useState)([]),[t3,t6]=(0,n.useState)([]),[t7,t8]=(0,n.useState)(0),[t9,ae]=(0,n.useState)(1),[at,aa]=(0,n.useState)(""),[as,an]=(0,n.useState)(""),[al,ar]=(0,n.useState)(!1),[ai,ao]=(0,n.useState)(!1),[ad,ac]=(0,n.useState)(null),[am,ax]=(0,n.useState)(!1),[au,ap]=(0,n.useState)(!1),[ag,ah]=(0,n.useState)("profile"),[ab,af]=(0,n.useState)(null),[ay,aj]=(0,n.useState)(""),[av,aN]=(0,n.useState)([]),[ak,aw]=(0,n.useState)(!1),[aC,a_]=(0,n.useState)({}),[aS,aL]=(0,n.useState)({}),[aE,aD]=(0,n.useState)({}),[aM,aB]=(0,n.useState)({}),[aA,aI]=(0,n.useState)([]),[aT,aU]=(0,n.useState)(null),[aR,aW]=(0,n.useState)(!1),[az,aP]=(0,n.useState)([]),[aF,aH]=(0,n.useState)(null),[aV,aO]=(0,n.useState)(!1),[aK,aq]=(0,n.useState)(new Set),[aG,aX]=(0,n.useState)([]),[aY,aJ]=(0,n.useState)(null),[a$,aQ]=(0,n.useState)(!1),[aZ,a0]=(0,n.useState)(new Set),[a2,a1]=(0,n.useState)(!1),[a4,a5]=(0,n.useState)(null),[a3,a6]=(0,n.useState)(h),[a7,a8]=(0,n.useState)(new Set),[a9,se]=(0,n.useState)({}),[st,sa]=(0,n.useState)(new Set),[ss,sn]=(0,n.useState)(null),[sl,sr]=(0,n.useState)(!1),[si,so]=(0,n.useState)("general"),[sd,sc]=(0,n.useState)({siteName:"CanHelp",siteUrl:"",contactEmail:"",supportPhone:""}),[sm,sx]=(0,n.useState)(!1),[su,sp]=(0,n.useState)(!1),[sg,sh]=(0,n.useState)({host:"",port:"587",username:"",password:"",fromName:"CanHelp",fromEmail:"",encryption:"tls"}),[sb,sf]=(0,n.useState)(!1),[sy,sj]=(0,n.useState)(!1),[sv,sN]=(0,n.useState)(!1),[sk,sw]=(0,n.useState)(null),[sC,s_]=(0,n.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}}:

"{{preview}}"

Ответить →'},offer_declined:{subject:"Ваше предложение отклонено: {{taskTitle}}",body:'

Ваше предложение отклонено

Привет, {{userName}}!

К сожалению, заказчик отклонил ваше предложение на:

{{taskTitle}}

Найти другие заказы →'},offer_other_accepted:{subject:"Выбран другой исполнитель: {{taskTitle}}",body:'

Выбран другой исполнитель

Привет, {{userName}}!

Заказчик выбрал другого исполнителя для задания:

{{taskTitle}}

Найти другие заказы →'},task_updated:{subject:"Задание обновлено: {{taskTitle}}",body:'

Задание обновлено

Привет, {{userName}}!

Заказчик обновил детали задания:

{{taskTitle}}

Смотреть заказ →'},deadline_reminder:{subject:"Задание истекает завтра: {{taskTitle}}",body:'

Напоминание о дедлайне

Привет, {{userName}}!

Ваше задание истекает через 24 часа. Обновите дедлайн, иначе задание будет автоматически снято с публикации.

{{taskTitle}}

Редактировать задание →'},task_archived:{subject:"Задание снято с публикации: {{taskTitle}}",body:'

Задание переведено в черновик

Привет, {{userName}}!

Ваше задание истекло и было автоматически переведено в черновик. Обновите дедлайн, чтобы опубликовать его снова.

{{taskTitle}}

Редактировать задание →'},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}}

Перейти к аккаунту →'}}),[sS,sL]=(0,n.useState)(null),[sE,sD]=(0,n.useState)("el"),[sM,sB]=(0,n.useState)(!1),[sA,sI]=(0,n.useState)(!1),[sT,sU]=(0,n.useState)({merchantId:"",apiUser:"",apiPassword:"",environment:"test",confirmationUrl:"",cancelUrl:"",enabled:!1}),[sR,sW]=(0,n.useState)(!1),[sz,sP]=(0,n.useState)(!1),[sF,sH]=(0,n.useState)({enabled:!1,planId:"",days:"30"}),[sV,sO]=(0,n.useState)(!1),[sK,sq]=(0,n.useState)(!1),[sG,sX]=(0,n.useState)({maintenanceMode:!1,indexingEnabled:!0,headScripts:"",siteTitleEl:"",siteTitleEn:"",siteTitleRu:"",siteTitleUk:"",siteDescriptionEl:"",siteDescriptionEn:"",siteDescriptionRu:"",siteDescriptionUk:""}),[sY,sJ]=(0,n.useState)(!1),[s$,sQ]=(0,n.useState)(!1),[sZ,s0]=(0,n.useState)("el"),[s2,s1]=(0,n.useState)({telegram:"",instagram:"",facebook:"",twitter:"",youtube:"",tiktok:"",whatsapp:"",viber:""}),[s4,s5]=(0,n.useState)(!1),[s3,s6]=(0,n.useState)(!1),[s7,s8]=(0,n.useState)({botToken:"",adminChatId:"",channelIdEl:"",channelIdEn:"",channelIdRu:"",channelIdUk:"",notifyRegistrations:!1,postNewTasks:!1}),[s9,ne]=(0,n.useState)(!1),[nt,na]=(0,n.useState)(!1),[ns,nn]=(0,n.useState)(!1),[nl,nr]=(0,n.useState)(!1),[ni,no]=(0,n.useState)(null),[nd,nc]=(0,n.useState)(null),[nm,nx]=(0,n.useState)(null),[nu,np]=(0,n.useState)({}),[ng,nh]=(0,n.useState)(!1),[nb,nf]=(0,n.useState)(null),[ny,nj]=(0,n.useState)(!1),[nv,nN]=(0,n.useState)(!1),[nk,nw]=(0,n.useState)([]),[nC,n_]=(0,n.useState)(!1),[nS,nL]=(0,n.useState)([]),[nE,nD]=(0,n.useState)(!1),[nM,nB]=(0,n.useState)(null),[nA,nI]=(0,n.useState)(null),[nT,nU]=(0,n.useState)(null),[nR,nW]=(0,n.useState)(!1),nz=e=>{nU(e),nW(!1)},nP=e=>{nU(e),nW(!0)},[nF,nH]=(0,n.useState)(null),[nV,nO]=(0,n.useState)(!1),[nK,nq]=(0,n.useState)("uk"),[nG,nX]=(0,n.useState)("el"),[nY,nJ]=(0,n.useState)({}),[n$,nQ]=(0,n.useState)(null),[nZ,n0]=(0,n.useState)(null),[n2,n1]=(0,n.useState)(null),[n4,n5]=(0,n.useState)(!1),[n3,n6]=(0,n.useState)(new Set),[n7,n8]=(0,n.useState)("broadcast"),[n9,le]=(0,n.useState)(""),[lt,la]=(0,n.useState)(""),[ls,ln]=(0,n.useState)(""),[ll,lr]=(0,n.useState)("general"),[li,lo]=(0,n.useState)(""),[ld,lc]=(0,n.useState)(!0),[lm,lx]=(0,n.useState)(!1),[lu,lp]=(0,n.useState)(null),[lg,lh]=(0,n.useState)(null),[lb,lf]=(0,n.useState)(!1),ly=!eo&&ei&&(null==(e=ei.user)?void 0:e.role)==="admin";async function lj(){if(lt.trim()){if("user"===n7&&!n9.trim())return void lh("Укажите ID пользователя");lx(!0),lh(null),lp(null);try{let e={title:lt.trim(),body:ls.trim()||void 0,type:ll.trim()||void 0,referenceId:li.trim()||void 0};if("broadcast"===n7){let t=await c.V7({...e,onlyActive:ld});lp(t)}else{let t=await c.g1(n9.trim(),e);lp(t)}}catch(e){lh((null==e?void 0:e.message)||"Не удалось отправить push")}finally{lx(!1)}}}async function lv(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 lN(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 lk(){if(ad){ax(!0);try{var e,t,a,s,n,l;let r=await c.wl(ad.id,{firstName:ad.firstName,lastName:ad.lastName,phone:ad.phone||null,bio:ad.bio||null,role:ad.role,planId:ad.planId||null,isActive:ad.isActive,locale:ad.locale,languages:null!=(e=ad.languages)?e:[],personalSiteSlug:ad.personalSiteSlug||null,showContactInfo:null!=(t=ad.showContactInfo)&&t,notifyNewTasks:null!=(a=ad.notifyNewTasks)&&a,notifMessages:null==(s=ad.notifMessages)||s,skills:null!=(n=ad.skills)?n:[],siteSettings:null!=(l=ad.siteSettings)?l:{}});ef(e=>e.map(e=>e.id===ad.id?r:e)),ac(null)}catch(e){}finally{ax(!1)}}}async function lw(){if(ad){ap(!0);try{let e=await c.uQ(ad.id);ac(t=>t?{...t,emailVerified:e.emailVerified}:t),ef(t=>t.map(t=>t.id===ad.id?{...t,emailVerified:e.emailVerified}:t))}catch(e){}finally{ap(!1)}}}async function lC(){if(!ad)return;let e=Number(ad.topUpAmount);if(e&&!(e<=0)){ar(!0);try{let t=await c.P0(ad.id,{amount:e,description:ad.topUpDescription||void 0});ef(e=>e.map(e=>e.id===ad.id?t.user:e)),ac(e=>e?{...e,...t.user,topUpAmount:"",topUpDescription:""}:e),"balances"===em&&c.g0({page:t9,userId:at||void 0,kind:as||void 0}).then(e=>{t6(e.data),t8(e.total)}).catch(()=>{})}catch(e){}finally{ar(!1)}}}async function l_(){if(!ad)return;let e=Number(ad.withdrawAmount);if(e&&!(e<=0)){ao(!0);try{let t=await c.hD(ad.id,{amount:e,description:ad.withdrawDescription||void 0});ef(e=>e.map(e=>e.id===ad.id?t.user:e)),ac(e=>e?{...e,...t.user,withdrawAmount:"",withdrawDescription:""}:e),"balances"===em&&c.g0({page:t9,userId:at||void 0,kind:as||void 0}).then(e=>{t6(e.data),t8(e.total)}).catch(()=>{})}catch(e){}finally{ao(!1)}}}async function lS(e){let t=av.find(t=>t.id===e);if(t){aL(t=>({...t,[e]:!0}));try{var a,s,n;let l=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!=(n=t.locations)?n:[],isActive:t.isActive});aN(t=>t.map(t=>t.id===e?l:t))}catch(e){}finally{aL(t=>({...t,[e]:!1}))}}}async function lL(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 lE(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 lD(e,t){let a=await c.eU(e,t).catch(()=>null);a&&eH(t=>t.map(t=>t.id===e?{...t,...a}:t))}function lM(e){aH({parentId:null!=e?e:null,slug:"",nameEl:"",nameEn:"",nameRu:"",nameUk:"",order:0,isActive:!0})}async function lB(){if(aF){aO(!0);try{if(aF.id){let e=await c.Nt(aF.id,aF);aP(t=>t.map(t=>t.id===aF.id?e:t))}else{let e=await c.yJ({slug:aF.slug,nameEl:aF.nameEl,nameEn:aF.nameEn,nameRu:aF.nameRu,nameUk:aF.nameUk,parentId:aF.parentId,order:aF.order});aP(t=>[...t,e])}aH(null)}catch(e){}finally{aO(!1)}}}async function lA(e,t){window.confirm("".concat(ed("admin.loc.delete.confirm"),'\n"').concat(t,'"'))&&await c.zR(e).catch(()=>null)&&aP(t=>t.filter(t=>t.id!==e))}function lI(e){a5(null),aJ({parentId:null!=e?e:null,slug:"",icon:"/category-icons/package.svg",namesEl:"",namesEn:"",namesRu:"",namesUk:"",order:0,isActive:!0})}async function lT(e){if("image/svg+xml"!==e.type)return void a5("Only SVG files are allowed");a1(!0),a5(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();aJ(e=>e?{...e,icon:s.url}:e)}catch(e){a5((null==e?void 0:e.message)||"Upload failed")}finally{a1(!1)}}async function lU(){if(aY){aQ(!0);try{if(aY.id){let e=await c.$7(aY.id,aY);aX(t=>t.map(t=>t.id===aY.id?e:t))}else{let e=await c.zZ({slug:aY.slug,icon:aY.icon,namesEl:aY.namesEl,namesEn:aY.namesEn,namesRu:aY.namesRu,namesUk:aY.namesUk,parentId:aY.parentId,order:aY.order});aX(t=>[...t,e])}aJ(null)}catch(e){}finally{aQ(!1)}}}async function lR(e,t){window.confirm("".concat(ed("admin.cat.delete.confirm"),'\n"').concat(t,'"'))&&await c.K7(e).catch(()=>null)&&aX(t=>t.filter(t=>t.id!==e))}async function lW(e){let t=e.id,a=e.slug;if(a8(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a}),!a9[a]){sa(e=>new Set(e).add(t));try{let e=await c.i_(a);se(t=>({...t,[a]:e}))}catch(e){}finally{sa(e=>{let a=new Set(e);return a.delete(t),a})}}}async function lz(){if(ss){sr(!0);try{if(ss.id){let e=await c.fP(ss.id,{nameEl:ss.nameEl,nameEn:ss.nameEn,nameRu:ss.nameRu,nameUk:ss.nameUk,order:ss.order});se(t=>{var a;return{...t,[ss.catSlug]:(null!=(a=t[ss.catSlug])?a:[]).map(t=>t.id===ss.id?e:t)}})}else{let e=await c.S9({categorySlug:ss.catSlug,nameEl:ss.nameEl,nameEn:ss.nameEn,nameRu:ss.nameRu,nameUk:ss.nameUk,order:ss.order});se(t=>{var a;return{...t,[ss.catSlug]:[...null!=(a=t[ss.catSlug])?a:[],e]}})}sn(null)}catch(e){}finally{sr(!1)}}}async function lP(e,t){(e._skipConfirm||window.confirm('Удалить навык "'.concat(e.nameEl,'"?')))&&(e._skipConfirm||await c.hp(e.id).catch(()=>null))&&se(a=>{var s;return{...a,[t]:(null!=(s=a[t])?s:[]).filter(t=>t.id!==e.id)}})}async function lF(){if(aT){aW(!0);try{let e={name:aT.name,description:aT.description||void 0,role:aT.role,tier:aT.tier,price:aT.price,oldPrice:aT.oldPrice||null,currency:aT.currency,maxTasks:aT.maxTasks?Number(aT.maxTasks):null,maxOffers:aT.maxOffers?Number(aT.maxOffers):null,maxCards:aT.maxCards?Number(aT.maxCards):null,maxMessagesPerDay:aT.maxMessagesPerDay?Number(aT.maxMessagesPerDay):null,maxOrdersPerDay:aT.maxOrdersPerDay?Number(aT.maxOrdersPerDay):null,maxSkills:aT.maxSkills?Number(aT.maxSkills):null,durationDays:aT.durationDays?Number(aT.durationDays):null,notifyNewTasks:aT.notifyNewTasks,searchBoost:aT.searchBoost,offersMultiplier:aT.offersMultiplier,canContactFreePlan:aT.canContactFreePlan,canContactProPlan:aT.canContactProPlan,canContactAll:aT.canContactAll,canShowContactInfo:aT.canShowContactInfo,canViewPhone:aT.canViewPhone,canUploadVideo:aT.canUploadVideo,hasFavorites:aT.hasFavorites,hasGoogleCalendar:aT.hasGoogleCalendar,hasVerifiedBadge:aT.hasVerifiedBadge,highlightedReviews:aT.highlightedReviews,hasPersonalSite:aT.hasPersonalSite,hasCanHelpNowStatus:aT.hasCanHelpNowStatus,hasNeedHelpStatus:aT.hasNeedHelpStatus,hasAutoResponse:aT.hasAutoResponse,hasAutoMatch:aT.hasAutoMatch,hasPriceList:aT.hasPriceList,receiveInstantDispatchFree:aT.receiveInstantDispatchFree,receiveInstantDispatchPro:aT.receiveInstantDispatchPro,features:aT.features?aT.features.split("\n").map(e=>e.trim()).filter(Boolean):[],isDefault:aT.isDefault,isActive:aT.isActive,order:aT.order};if(aT.id){let t=await c.td(aT.id,e);aI(e=>e.map(e=>e.id===aT.id?t:e))}else{let t=await c.qT(e);aI(e=>[...e,t])}aT.isDefault&&c.OX().then(aI).catch(()=>{}),aU(null)}catch(e){}finally{aW(!1)}}}async function lH(e,t){window.confirm('Удалить тариф "'.concat(t,'"?'))&&await c.bR(e).catch(()=>null)&&aI(t=>t.filter(t=>t.id!==e))}async function lV(){sx(!0);try{await c.CX({"general.siteName":sd.siteName,"general.siteUrl":sd.siteUrl,"general.contactEmail":sd.contactEmail,"general.supportPhone":sd.supportPhone}),sp(!0),setTimeout(()=>sp(!1),2500)}catch(e){}finally{sx(!1)}}async function lO(){sf(!0);try{await c.CX({"smtp.host":sg.host,"smtp.port":sg.port,"smtp.username":sg.username,"smtp.password":sg.password,"smtp.fromName":sg.fromName,"smtp.fromEmail":sg.fromEmail,"smtp.encryption":sg.encryption}),sj(!0),setTimeout(()=>sj(!1),2500)}catch(e){}finally{sf(!1)}}async function lK(e){var t,a;let s="".concat(e,"_").concat(sE),n=null!=(a=null!=(t=sC[s])?t:sC[e])?a:{subject:"",body:""};if(n.subject||n.body){sI(!0);try{await c.jg(s,n);let t=await c.wc({subject:n.subject,body:n.body,fromLocale:sE});s_(a=>{let l={...a,[s]:n};for(let[a,s]of Object.entries(t))l["".concat(e,"_").concat(a)]=s;return l}),await Promise.all(Object.entries(t).map(t=>{let[a,s]=t;return c.jg("".concat(e,"_").concat(a),s)}))}catch(e){}finally{sI(!1)}}}async function lq(e){let t="".concat(e,"_").concat(sE);sB(!0);try{var a;await c.jg(t,null!=(a=sC[t])?a:{subject:"",body:""}),sL(null)}catch(e){}finally{sB(!1)}}async function lG(){sW(!0);try{await c.CX({"payment.epay.merchantId":sT.merchantId,"payment.epay.apiUser":sT.apiUser,"payment.epay.apiPassword":sT.apiPassword,"payment.epay.environment":sT.environment,"payment.epay.confirmationUrl":sT.confirmationUrl,"payment.epay.cancelUrl":sT.cancelUrl,"payment.epay.enabled":String(sT.enabled)}),sP(!0),setTimeout(()=>sP(!1),2500)}catch(e){}finally{sW(!1)}}async function lX(){sO(!0);try{await c.CX({referral_enabled:String(sF.enabled),referral_plan_id:sF.planId,referral_days:sF.days}),sq(!0),setTimeout(()=>sq(!1),2500)}catch(e){}finally{sO(!1)}}async function lY(){sJ(!0);try{await c.CX({"seo.maintenanceMode":String(sG.maintenanceMode),"seo.indexingEnabled":String(sG.indexingEnabled),"seo.headScripts":sG.headScripts,"seo.siteTitle.el":sG.siteTitleEl,"seo.siteTitle.en":sG.siteTitleEn,"seo.siteTitle.ru":sG.siteTitleRu,"seo.siteTitle.uk":sG.siteTitleUk,"seo.siteDescription.el":sG.siteDescriptionEl,"seo.siteDescription.en":sG.siteDescriptionEn,"seo.siteDescription.ru":sG.siteDescriptionRu,"seo.siteDescription.uk":sG.siteDescriptionUk}),sQ(!0),setTimeout(()=>sQ(!1),2500)}catch(e){}finally{sJ(!1)}}async function lJ(){s5(!0);try{await c.CX({"social.telegram":s2.telegram,"social.instagram":s2.instagram,"social.facebook":s2.facebook,"social.twitter":s2.twitter,"social.youtube":s2.youtube,"social.tiktok":s2.tiktok,"social.whatsapp":s2.whatsapp,"social.viber":s2.viber}),s6(!0),setTimeout(()=>s6(!1),2500)}catch(e){}finally{s5(!1)}}async function l$(){ne(!0);try{await c.CX({"telegram.botToken":s7.botToken,"telegram.adminChatId":s7.adminChatId,"telegram.channelId.el":s7.channelIdEl,"telegram.channelId.en":s7.channelIdEn,"telegram.channelId.ru":s7.channelIdRu,"telegram.channelId.uk":s7.channelIdUk,"telegram.notifyRegistrations":String(s7.notifyRegistrations),"telegram.postNewTasks":String(s7.postNewTasks)}),na(!0),setTimeout(()=>na(!1),2500)}catch(e){}finally{ne(!1)}}async function lQ(e){var t,a;let s=null!=(t=({admin:s7.adminChatId,el:s7.channelIdEl,en:s7.channelIdEn,ru:s7.channelIdRu,uk:s7.channelIdUk})[e])?t:"";"admin"===e?(nn(!0),no(null)):(nx(e),np(t=>{let a={...t};return delete a[e],a}));try{let t=await c.qX(s7.botToken,s),n={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?no(n):np(t=>({...t,[e]:n}))}catch(a){let t={ok:!1,msg:ed("admin.settings.telegram.test_fail")};"admin"===e?no(t):np(a=>({...a,[e]:t}))}finally{"admin"===e?nn(!1):nx(null)}}async function lZ(){nh(!0),nf(null);try{var e;let t=await c.cl(s7.botToken);nf({ok:t.ok,msg:t.ok?"@".concat(t.botName):null!=(e=t.error)?e:ed("admin.settings.telegram.test_fail")})}catch(e){nf({ok:!1,msg:ed("admin.settings.telegram.test_fail")})}finally{nh(!1)}}if((0,n.useEffect)(()=>{var e;eo||ei||er.push("/login"),!eo&&ei&&(null==(e=ei.user)?void 0:e.role)!=="admin"&&er.push("/")},[ei,eo]),(0,n.useEffect)(()=>{ly&&(c.dE().then(eh).catch(()=>{}),c.bi().then(t1).catch(()=>{}),c.u4().then(t5).catch(()=>{}))},[ly]),(0,n.useEffect)(()=>{ly&&"users"===em&&(lf(!0),c.cS(ey,ek||void 0,eS||void 0).then(e=>{ef(e.data),eN(e.total)}).catch(()=>{}).finally(()=>lf(!1)))},[ly,em,ey,ek,eS]),(0,n.useEffect)(()=>{ly&&"tasks"===em&&(lf(!0),c.Yj(eM,eT||void 0,ez||void 0).then(e=>{eD(e.data),eI(e.total)}).catch(()=>{}).finally(()=>lf(!1)))},[ly,em,eM,eT,ez]),(0,n.useEffect)(()=>{ly&&"reports"===em&&(lf(!0),c.z5(eV).then(e=>{eH(e.data),eq(e.total)}).catch(()=>{}).finally(()=>lf(!1)))},[ly,em,eV]),(0,n.useEffect)(()=>{if(!ly||"support"!==em)return;lf(!0);let e={page:String(eY),limit:"30"};eZ&&(e.status=eZ),e2&&(e.type=e2),e4&&(e.q=e4),c.KZ(e).then(e=>{eX(e.data),eQ(e.total)}).catch(()=>{}).finally(()=>lf(!1))},[ly,em,eY,eZ,e2,e4]),(0,n.useEffect)(()=>{ly&&"balances"===em&&(lf(!0),c.g0({page:t9,userId:at||void 0,kind:as||void 0}).then(e=>{t6(e.data),t8(e.total)}).catch(()=>{}).finally(()=>lf(!1)))},[ly,em,t9,at,as]),(0,n.useEffect)(()=>{ly&&"logs"===em&&("ai"===tz?(lf(!0),c.j_(tl).then(e=>{tn(e.data),to(e.total)}).catch(()=>{}).finally(()=>lf(!1))):"activity"===tz?c.yO({page:tu,event:tg||void 0,userId:tb||void 0,dateFrom:ty||void 0,dateTo:tv||void 0}).then(e=>{var t;tc(e.data),tx(e.total),(null==(t=e.eventTypes)?void 0:t.length)&&tw(e.eventTypes)}).catch(()=>{}):"mail"===tz?c.qt({page:tE,event:tM||void 0,dateFrom:tA||void 0,dateTo:tT||void 0}).then(e=>{var t;t_(e.data),tL(e.total),(null==(t=e.eventTypes)?void 0:t.length)&&tW(e.eventTypes)}).catch(()=>{}):"notifications"===tz&&c.Br({page:tV,type:tG||void 0,dateFrom:t$||void 0,dateTo:tZ||void 0}).then(e=>{var t;tH(e.data),tq(e.total),(null==(t=e.notifTypes)?void 0:t.length)&&tJ(e.notifTypes)}).catch(()=>{}))},[ly,em,tz,tl,tu,tg,tb,ty,tv,tE,tM,tA,tT,tV,tG,t$,tZ]),(0,n.useEffect)(()=>{tp(1)},[tg,tb,ty,tv]),(0,n.useEffect)(()=>{tD(1)},[tM,tA,tT]),(0,n.useEffect)(()=>{tO(1)},[tG,t$,tZ]),(0,n.useEffect)(()=>{ly&&"plans"===em&&c.OX().then(aI).catch(()=>{})},[ly,em]),(0,n.useEffect)(()=>{ly&&"translations"===em&&(nO(!0),c.YQ().then(e=>nH(e.tables)).catch(()=>{}).finally(()=>nO(!1)))},[ly,em]),(0,n.useEffect)(()=>{ly&&"backup"===em&&((0,c.Em)("/admin/backup/settings").then(e=>nj(!!e.autoEnabled)).catch(()=>{}),n_(!0),(0,c.Em)("/admin/backup/tables").then(e=>nw(e.tables||[])).catch(()=>{}).finally(()=>n_(!1)),(0,c.Em)("/admin/backup/list").then(e=>nL(e.files||[])).catch(()=>{}))},[ly,em]),(0,n.useEffect)(()=>{ly&&"referrals"===em&&(n5(!0),c.cJ().then(e=>n1(e)).catch(()=>{}).finally(()=>n5(!1)))},[ly,em]),(0,n.useEffect)(()=>{ly&&"users"===em&&0===aA.length&&c.OX().then(aI).catch(()=>{})},[ly,em]),(0,n.useEffect)(()=>{ej(1)},[ek,eS]),(0,n.useEffect)(()=>{eB(1)},[eT,ez]),(0,n.useEffect)(()=>{ae(1)},[at,as]),(0,n.useEffect)(()=>{ly&&"locations"===em&&c.k_().then(aP).catch(()=>{})},[ly,em]),(0,n.useEffect)(()=>{ly&&"categories"===em&&c.KD().then(aX).catch(()=>{})},[ly,em]),(0,n.useEffect)(()=>{ly&&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&&a6(t)}).catch(()=>{})},[ly]),(0,n.useEffect)(()=>{ly&&"settings"===em&&(0===aA.length&&c.OX().then(aI).catch(()=>{}),c.rC().then(e=>{var t,a,s,n,l,r,i,o,d,c,m,x,u,p,g,h,b,f,y,j,v,N,k,w,C,_,S,L,E,D,M,B,A,I,T,U,R,W,z,P,F,H,V,O,K,q,G,X;sc({siteName:null!=(t=e["general.siteName"])?t:"CanHelp",siteUrl:null!=(a=e["general.siteUrl"])?a:"",contactEmail:null!=(s=e["general.contactEmail"])?s:"",supportPhone:null!=(n=e["general.supportPhone"])?n:""}),sh({host:null!=(l=e["smtp.host"])?l:"",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"}),sU({merchantId:null!=(x=e["payment.epay.merchantId"])?x:"",apiUser:null!=(u=e["payment.epay.apiUser"])?u:"",apiPassword:null!=(p=e["payment.epay.apiPassword"])?p:"",environment:null!=(g=e["payment.epay.environment"])?g:"test",confirmationUrl:null!=(h=e["payment.epay.confirmationUrl"])?h:"",cancelUrl:null!=(b=e["payment.epay.cancelUrl"])?b:"",enabled:"true"===e["payment.epay.enabled"]}),sH({enabled:"true"===e.referral_enabled,planId:null!=(j=null!=(y=null!=(f=e.referral_plan_id)?f:e.referral_customer_plan_id)?y:e.referral_specialist_plan_id)?j:"",days:null!=(k=null!=(N=null!=(v=e.referral_days)?v:e.referral_customer_days)?N:e.referral_specialist_days)?k:"30"}),sX({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!=(B=e["seo.siteDescription.en"])?B:"",siteDescriptionRu:null!=(A=e["seo.siteDescription.ru"])?A:"",siteDescriptionUk:null!=(I=e["seo.siteDescription.uk"])?I:""}),s1({telegram:null!=(T=e["social.telegram"])?T:"",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:""}),s8({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};s_(e=>({...e,...t}))}).catch(()=>{}))},[ly,em]),eo)return(0,s.jsx)("div",{className:"text-center py-20 text-gray-500",children:ed("common.loading")});let l0="ru"===ec?"ru-RU":"en"===ec?"en-US":"el-GR",l2=[{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"),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:"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"})})}],l1={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"},l4={pending:"bg-yellow-100 text-yellow-700",reviewed:"bg-green-100 text-green-700",dismissed:"bg-gray-100 text-gray-500"},l5={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"};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:()=>ep(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"})})}),l2.map(e=>{let{key:t,label:a,icon: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:n}),!eu&&(0,s.jsx)("span",{children:a})]},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==eg?void 0:eg.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==eg?void 0:eg.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==eg?void 0:eg.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==eg?void 0:eg.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==eg?void 0:eg.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:n,color:l}=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(l),children:n}),(0,s.jsx)("div",{className:"text-3xl font-bold ".concat(l),children:null!=a?a:"—"}),(0,s.jsx)("div",{className:"text-sm text-gray-500 mt-1",children:t})]},t)})}),(null==eg?void 0:eg.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:eg.usersByDay,color:"#3b82f6",fill:"#3b82f615",label:ed("admin.stats.users_label")},{data:eg.specialistsByDay,color:"#a855f7",fill:"#a855f710",label:ed("admin.stats.specialists_label")},{data:eg.tasksByDay,color:"#22c55e",fill:"#22c55e10",label:ed("admin.stats.tasks_label")}]})]}),(null==eg?void 0:eg.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=eg.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[...eg.tasksByStatus].sort((e,t)=>a.indexOf(e.status)-a.indexOf(t.status)).map(a=>{var n;let{status:l,count:r}=a,i=null!=(n=t[l])?n:{label:l,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,"%"]})]},l)})})()})]}),t2.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:t2,color:"#f97316",fill:"#f9731615",label:ed("admin.stats.notif_label")}]})]}),t4.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:t4,color:"#0ea5e9",fill:"#0ea5e915",label:ed("admin.stats.mail_label")}]})]}),eg&&(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(eg.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(eg.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=eg.totalCostUsd)?a:0).toFixed(4)]})]})]}),(null==(t=eg.tokensByMonth)?void 0:t.length)>0&&(0,s.jsx)(A,{dateLocale:l0,series:[{data:eg.tokensByMonth.map(e=>({month:e.month,count:Number(e.output)})),color:"#8b5cf6",fill:"#8b5cf610",label:ed("admin.stats.tokens_out_label")},{data:eg.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:lb?(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=aA.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(l0)}),(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:()=>{ah("profile"),aj(""),af(null),aN([]),a_({}),aL({}),aD({}),aB({}),ac({...e,topUpAmount:"",topUpDescription:"",withdrawAmount:"",withdrawDescription:""}),c.jd(e.id).then(e=>ac(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:()=>lv(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:ev,limit:20,onChange:ej,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:at,onChange:e=>aa(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:as,onChange:e=>an(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:lb?(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===t3.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","Записей пока нет")})}):t3.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(l0)})]},e.id)})})]}),(0,s.jsx)(E,{page:t9,total:t7,limit:50,onChange:ae,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:lb?(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 n=e.task||e,l=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(n.id),className:"hover:text-green-600 truncate block",target:"_blank",children:"en"===ec&&n.titleEn||"ru"===ec&&n.titleRu||"uk"===ec&&n.titleUk||n.titleEl||n.title})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500 text-xs",children:null!=(t=null==l?void 0:l.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=l1[n.status])?a:"bg-gray-100 text-gray-600"),children:ed("task.status.".concat(n.status),n.status)})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500",children:n.budget?"".concat((0,x.$g)(n.budget),"€"):"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-400",children:new Date(n.createdAt).toLocaleDateString(l0)}),(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"!==n.status&&"completed"!==n.status&&(0,s.jsx)("button",{onClick:()=>lL(n.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:()=>lE(n.id,"en"===ec&&n.titleEn||"ru"===ec&&n.titleRu||"uk"===ec&&n.titleUk||n.titleEl||n.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")})]})})]},n.id)})})]}),(0,s.jsx)(E,{page:eM,total:eA,limit:20,onChange:eB,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:()=>lI(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")]})]}),aY&&(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:[aY.id?ed("admin.cat.edit"):ed("admin.cat.new"),aY.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:aY.slug,onChange:e=>aJ(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:aY.icon,onChange:e=>aJ(t=>t&&{...t,icon:e}),onUpload:lT,uploading:a2,error:a4,presets:a3})]}),(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:aY.order,onChange:e=>aJ(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:aY.namesEl,onChange:e=>aJ(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:aY.namesEn,onChange:e=>aJ(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:aY.namesRu,onChange:e=>aJ(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:aY.namesUk,onChange:e=>aJ(t=>t&&{...t,namesUk:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]})]}),aY.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:aY.isActive,onChange:e=>aJ(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:lU,disabled:a$,className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:a$?ed("common.saving"):ed("common.save")}),(0,s.jsx)("button",{onClick:()=>aJ(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===aG.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:aG,parentId:null,depth:0,locale:ec,expanded:aZ,onToggle:function(e){a0(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})},onEdit:function(e){var t,a,s,n,l,r,i,o,d,c,m,x,u,p,g;let h="string"==typeof e.icon?e.icon:"",b=new Set(a3.map(e=>e.value)),f=h.startsWith("/category-icons/")&&!b.has(h)?"/category-icons/package.svg":h||"/category-icons/package.svg";a5(null),aJ({id:e.id,parentId:null!=(l=e.parentId)?l: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==(n=e.names)?void 0:n.uk)?u:"",order:null!=(p=e.order)?p:0,isActive:null==(g=e.isActive)||g})},onDelete:lR,onAddChild:lI,skillsExpanded:a7,skillsCache:a9,skillsLoading:st,onToggleSkills:lW,skillForm:ss,skillSaving:sl,onOpenAddSkill:function(e){sn({catSlug:e,nameEl:"",nameEn:"",nameRu:"",nameUk:"",order:0})},onOpenEditSkill:function(e,t){var a,s,n,l,r;sn({id:e.id,catSlug:t,nameEl:null!=(a=e.nameEl)?a:"",nameEn:null!=(s=e.nameEn)?s:"",nameRu:null!=(n=e.nameRu)?n:"",nameUk:null!=(l=e.nameUk)?l:"",order:null!=(r=e.order)?r:0})},onSaveSkill:lz,onDeleteSkill:lP,onCancelSkillForm:()=>sn(null),onSkillFormChange:sn,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:()=>lM(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")]})]}),aF&&(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:[aF.id?ed("admin.loc.edit"):ed("admin.loc.new"),aF.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:aF.slug,onChange:e=>aH(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:aF.nameEl,onChange:e=>aH(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:aF.nameEn,onChange:e=>aH(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:aF.nameRu,onChange:e=>aH(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:aF.nameUk,onChange:e=>aH(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:aF.order,onChange:e=>aH(t=>t&&{...t,order:Number(e.target.value)}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),aF.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:aF.isActive,onChange:e=>aH(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:lB,disabled:aV,className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:aV?ed("common.saving"):ed("common.save")}),(0,s.jsx)("button",{onClick:()=>aH(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===az.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:az,parentId:null,depth:0,locale:ec,expanded:aK,onToggle:function(e){aq(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})},onEdit:function(e){var t,a,s,n,l,r,i,o,d,c,m,x,u,p,g;aH({id:e.id,parentId:null!=(l=e.parentId)?l: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==(n=e.names)?void 0:n.uk)?u:"",order:null!=(p=e.order)?p:0,isActive:null==(g=e.isActive)||g})},onDelete:lA,onAddChild:lM,t:ed})})]}),"reports"===em&&(0,s.jsxs)("div",{className:"space-y-3",children:[lb?(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,n;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=l4[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!=(n=l5[e.reason])?n:"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(l0)})]}),"pending"===e.status&&(0,s.jsxs)("div",{className:"flex gap-2 flex-shrink-0",children:[(0,s.jsx)("button",{onClick:()=>lD(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:()=>lD(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")})]}),"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:()=>tP(t),className:"px-4 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(tz===t?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-700"),children:a},t)})}),"ai"===tz&&(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"),": ",ti]}),(0,s.jsxs)("button",{onClick:()=>{tr(1),c.j_(1).then(e=>{tn(e.data),to(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")]})]}),lb?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("common.loading")}):0===ts.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:ts.map(e=>{var t,a,n,l,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(l0)}),(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!=(n=e.totalTokens)?n:"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-right text-gray-500",children:null!=(l=e.durationMs)?l:"—"}),(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:tl,total:ti,limit:50,onChange:tr,totalLabel:ed("admin.pagination.total")})]}),"activity"===tz&&(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:tg,onChange:e=>th(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")}),tk.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:ty,onChange:e=>tj(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:tv,onChange:e=>tN(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(tg||ty||tv||tb)&&(0,s.jsxs)("button",{onClick:()=>{th(""),tj(""),tN(""),tf("")},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"),": ",tm]})]}),0===td.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:td.map(e=>(0,s.jsx)(B,{entry:e,dateLocale:l0,onFilterUser:e=>{tf(e),th("")},t:ed},e.id))}),(0,s.jsx)(E,{page:tu,total:tm,limit:50,onChange:tp,totalLabel:ed("admin.pagination.total")})]}),"mail"===tz&&(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:tM,onChange:e=>tB(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")}),tR.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:tA,onChange:e=>tI(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:tT,onChange:e=>tU(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(tM||tA||tT)&&(0,s.jsxs)("button",{onClick:()=>{tB(""),tI(""),tU("")},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"),": ",tS]})]}),0===tC.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:tC.map(e=>{let t=D(e.details),a="string"==typeof(null==t?void 0:t.provider)?t.provider:"—",n="string"==typeof(null==t?void 0:t.to)?t.to:e.userEmail||"—",l="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(l0)}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-700",children:n}),(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:l||r||void 0,children:l||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:tE,total:tS,limit:50,onChange:tD,totalLabel:ed("admin.pagination.total")})]}),"notifications"===tz&&(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:tG,onChange:e=>tX(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")}),tY.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:t$,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.activity.to")}),(0,s.jsx)("input",{type:"date",value:tZ,onChange:e=>t0(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(tG||t$||tZ)&&(0,s.jsxs)("button",{onClick:()=>{tX(""),tQ(""),t0("")},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"),": ",tK]})]}),0===tF.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:tF.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(l0)}),(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:tV,total:tK,limit:50,onChange:tO,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(){aU({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")})]}),aT&&(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:aT.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:aT.name,onChange:e=>aU({...aT,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:aT.price,onChange:e=>aU({...aT,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=aT.oldPrice)?r:"",onChange:e=>aU({...aT,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:aT.tier,onChange:e=>aU({...aT,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:aT.description,onChange:e=>aU({...aT,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:aT.maxTasks,onChange:e=>aU({...aT,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:aT.maxOffers,onChange:e=>aU({...aT,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:aT.maxCards,onChange:e=>aU({...aT,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:aT.maxMessagesPerDay,onChange:e=>aU({...aT,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:aT.maxOrdersPerDay,onChange:e=>aU({...aT,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:aT.maxSkills,onChange:e=>aU({...aT,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:aT.durationDays,onChange:e=>aU({...aT,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:aT.searchBoost,onChange:e=>aU({...aT,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:aT.offersMultiplier,onChange:e=>aU({...aT,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:aT.features,onChange:e=>aU({...aT,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:aT[t],onChange:e=>aU({...aT,[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:aT[t],onChange:e=>aU({...aT,[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:aT.isDefault,onChange:e=>aU({...aT,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:aT.isActive,onChange:e=>aU({...aT,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:aT.order,onChange:e=>aU({...aT,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:lF,disabled:aR||!aT.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:aR?"...":ed("common.save")}),(0,s.jsx)("button",{onClick:()=>aU(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===aA.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:aA.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(aI)).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,n,l,r,i,o,d,c,m,x,u,p,g,h,b,f,y,j,v,N,k,w,C,_,S,L,E,D,M;aU({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!=(n=e.price)?n:"0",oldPrice:null!=(l=e.oldPrice)?l:"",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!=(p=e.canContactFreePlan)&&p,canContactProPlan:null==(g=e.canContactProPlan)||g,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!=(j=e.hasFavorites)&&j,hasGoogleCalendar:null!=(v=e.hasGoogleCalendar)&&v,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:()=>lH(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:()=>so(e),className:"px-4 py-2 rounded-lg text-sm font-medium transition ".concat(si===e?"bg-green-600 text-white shadow-sm":"text-gray-600 hover:bg-gray-100"),children:t[e]},e)})}),"general"===si&&(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:sd.siteName,onChange:e=>sc(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:sd.siteUrl,onChange:e=>sc(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:sd.contactEmail,onChange:e=>sc(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:sd.supportPhone,onChange:e=>sc(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:lV,disabled:sm,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:sm?ed("admin.settings.saving"):su?ed("admin.settings.saved"):ed("common.save")})]})]}),"smtp"===si&&(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:sg.host,onChange:e=>sh(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:sg.port,onChange:e=>sh(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:sg.encryption,onChange:e=>sh(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:sg.username,onChange:e=>sh(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:sg.password,onChange:e=>sh(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:sg.fromName,onChange:e=>sh(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:sg.fromEmail,onChange:e=>sh(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:lO,disabled:sb,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:sb?ed("admin.settings.saving"):sy?ed("admin.settings.saved"):ed("common.save")}),(0,s.jsx)("button",{onClick:async()=>{sN(!0),sw(null);try{let e=await c.FI();sw("✓ Отправлено на ".concat(e.to))}catch(e){sw("✗ Ошибка: ".concat(e.message))}finally{sN(!1),setTimeout(()=>sw(null),5e3)}},disabled:sv,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:sv?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")]})}),sk&&(0,s.jsx)("p",{className:"text-sm text-center font-medium ".concat(sk.startsWith("✓")?"text-green-600":"text-red-500"),children:sk})]})]}),"payment"===si&&(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:()=>sU(e=>({...e,enabled:!e.enabled})),className:"relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(sT.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(sT.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:sT.environment,onChange:e=>sU(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:sT.merchantId,onChange:e=>sU(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:sT.apiUser,onChange:e=>sU(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:sT.apiPassword,onChange:e=>sU(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:sT.confirmationUrl,onChange:e=>sU(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:sT.cancelUrl,onChange:e=>sU(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:lG,disabled:sR,className:"px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:sR?ed("admin.settings.saving"):ed("common.save")}),sz&&(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"===si&&(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")," ",g.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,n;let{key:l,label:r,icon:i}=e,o="".concat(l,"_").concat(sE),d=null!=(a=null!=(t=sC[o])?t:sC[l])?a:{subject:"",body:""},c=sS===l,m=null!=(n=p[l])?n:[];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:()=>sL(c?null:l),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:()=>sD(e),className:"px-3 py-1 text-xs font-medium rounded-md transition-colors ".concat(sE===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=>s_(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=>s_(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:()=>lq(l),disabled:sM||sA,className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:sM?ed("admin.notif.tmpl.saving"):ed("admin.notif.tmpl.save")}),(0,s.jsxs)("button",{onClick:()=>lK(l),disabled:sM||sA,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"})}),sA?ed("admin.notif.tmpl.translating"):ed("admin.notif.tmpl.translate")]}),(0,s.jsx)("button",{onClick:()=>sL(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")})]})]})]},l)})]}),"referral"===si&&(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:()=>sH(e=>({...e,enabled:!e.enabled})),className:"relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(sF.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(sF.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:sF.planId,onChange:e=>sH(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")}),aA.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:sF.days,onChange:e=>sH(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:lX,disabled:sV,className:"px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:sV?ed("admin.settings.saving"):ed("common.save")}),sK&&(0,s.jsx)("span",{className:"text-sm text-green-600",children:ed("admin.settings.saved")})]})]}),"socials"===si&&(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:n,icon:l}=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(s2[t]?"text-green-600":"text-gray-300"),children:l}),a,!s2[t]&&(0,s.jsx)("span",{className:"text-xs font-normal text-gray-400 ml-auto",children:"не заполнено"})]}),(0,s.jsx)("input",{type:"url",value:s2[t],onChange:e=>s1(a=>({...a,[t]:e.target.value})),placeholder:n,className:"w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(s2[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:lJ,disabled:s4,className:"px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:s4?ed("admin.settings.saving"):ed("common.save")}),s3&&(0,s.jsx)("span",{className:"text-sm text-green-600",children:ed("admin.settings.saved")})]})]}),"seo"===si&&(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:()=>sX(e=>({...e,maintenanceMode:!e.maintenanceMode})),className:"relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(sG.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(sG.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:()=>sX(e=>({...e,indexingEnabled:!e.indexingEnabled})),className:"relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(sG.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(sG.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:n}=e;return(0,s.jsxs)("button",{type:"button",onClick:()=>s0(t),className:"flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(sZ===t?"bg-green-600 text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"),children:[a," ",n]},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:sG["siteTitle".concat(sZ.charAt(0).toUpperCase()+sZ.slice(1))],onChange:e=>sX(t=>({...t,["siteTitle".concat(sZ.charAt(0).toUpperCase()+sZ.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"===sZ?"CanHelp — Κάθε άνθρωπος έχει κάτι να προσφέρει":"en"===sZ?"CanHelp — Everyone has something valuable to offer":"ru"===sZ?"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:sG["siteDescription".concat(sZ.charAt(0).toUpperCase()+sZ.slice(1))],onChange:e=>sX(t=>({...t,["siteDescription".concat(sZ.charAt(0).toUpperCase()+sZ.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"===sZ?"Η ελληνική πλατφόρμα για online ανάθεση εργασιών...":"en"===sZ?"The Greek platform for online task delegation...":"ru"===sZ?"Греческая платформа для онлайн-поиска специалистов...":"Грецька платформа для пошуку фахівців онлайн..."})]})}),(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:sG.headScripts,onChange:e=>sX(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