/
opt
/
canhelp
/
apps
/
web
/
.next
/
server
/
app
/
admin
/
/opt/canhelp/apps/web/.next/server/app/admin
mkdir
upload
Name
Size
Mode
Actions
page.js
280192
0644
edit
dl
rm
page.js.nft.json
7950
0644
edit
dl
rm
page_client-reference-manifest.js
19722
0644
edit
dl
rm
Edit:
/opt/canhelp/apps/web/.next/server/app/admin/page.js
(280192B)
(()=>{var a={};a.id=698,a.ids=[698],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8293:(a,b,c)=>{"use strict";function d(a,b){return"el"===b&&a.titleEl?a.titleEl:"en"===b&&a.titleEn?a.titleEn:"ru"===b&&a.titleRu?a.titleRu:a.title}function e(a){return null==a||""===a?"":Math.round(Number(a)).toString()}function f(a,b){return"el"===b&&a.descriptionEl?a.descriptionEl:"en"===b&&a.descriptionEn?a.descriptionEn:"ru"===b&&a.descriptionRu?a.descriptionRu:a.description}c.d(b,{$g:()=>e,GZ:()=>f,Oj:()=>d})},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},23749:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(25459).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/admin/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/opt/canhelp/apps/web/src/app/admin/page.tsx","default")},26713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33677:(a,b,c)=>{Promise.resolve().then(c.bind(c,23749))},33689:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GlobalError:()=>D.a,__next_app__:()=>J,handler:()=>L,pages:()=>I,routeModule:()=>K,tree:()=>H});var d=c(73653),e=c(97714),f=c(85250),g=c(37587),h=c(22369),i=c(1889),j=c(96232),k=c(22841),l=c(46537),m=c(46027),n=c(78559),o=c(75928),p=c(19374),q=c(65971),r=c(261),s=c(79898),t=c(32967),u=c(26713),v=c(40139),w=c(14248),x=c(59580),y=c(57749),z=c(53123),A=c(89745),B=c(86439),C=c(58671),D=c.n(C),E=c(18283),F=c(39818),G={};for(let a in E)0>["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(a)&&(G[a]=()=>E[a]);c.d(b,G);let H={children:["",{children:["admin",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,23749)),"/opt/canhelp/apps/web/src/app/admin/page.tsx"]}]},{metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,2645))).default(a)],apple:[async a=>(await Promise.resolve().then(c.bind(c,45639))).default(a)],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(c.bind(c,47570)),"/opt/canhelp/apps/web/src/app/layout.tsx"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,58671,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.bind(c,33506)),"/opt/canhelp/apps/web/src/app/not-found.tsx"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,15034,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,54693,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,2645))).default(a)],apple:[async a=>(await Promise.resolve().then(c.bind(c,45639))).default(a)],openGraph:[],twitter:[],manifest:void 0}}]}.children,I=["/opt/canhelp/apps/web/src/app/admin/page.tsx"],J={require:c,loadChunk:()=>Promise.resolve()},K=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/admin/page",pathname:"/admin",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:H},distDir:".next",relativeProjectDir:""});async function L(a,b,d){var C;let G="/admin/page";"/index"===G&&(G="/");let M=(0,h.getRequestMeta)(a,"postponed"),N=(0,h.getRequestMeta)(a,"minimalMode"),O=await K.prepare(a,b,{srcPage:G,multiZoneDraftMode:!1});if(!O)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:P,query:Q,params:R,parsedUrl:S,pageIsDynamic:T,buildManifest:U,nextFontManifest:V,reactLoadableManifest:W,serverActionsManifest:X,clientReferenceManifest:Y,subresourceIntegrityManifest:Z,prerenderManifest:$,isDraftMode:_,resolvedPathname:aa,revalidateOnlyGenerated:ab,routerServerContext:ac,nextConfig:ad,interceptionRoutePatterns:ae}=O,af=S.pathname||"/",ag=(0,r.normalizeAppPath)(G),{isOnDemandRevalidate:ah}=O,ai=K.match(af,$),aj=!!$.routes[aa],ak=!!(ai||aj||$.routes[ag]),al=a.headers["user-agent"]||"",am=(0,u.getBotType)(al),an=(0,p.isHtmlBotRequest)(a),ao=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[t.NEXT_ROUTER_PREFETCH_HEADER],ap=(0,h.getRequestMeta)(a,"isRSCRequest")??!!a.headers[t.RSC_HEADER],aq=(0,s.getIsPossibleServerAction)(a),ar=(0,m.checkIsAppPPREnabled)(ad.experimental.ppr)&&(null==(C=$.routes[ag]??$.dynamicRoutes[ag])?void 0:C.renderingMode)==="PARTIALLY_STATIC",as=!1,at=!1,au=ar?M:void 0,av=ar&&ap&&!ao,aw=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),ax=!al||(0,p.shouldServeStreamingMetadata)(al,ad.htmlLimitedBots);an&&ar&&(ak=!1,ax=!1);let ay=!0===K.isDev||!ak||"string"==typeof M||av,az=an&&ar,aA=null;_||!ak||ay||aq||au||av||(aA=aa);let aB=aA;!aB&&K.isDev&&(aB=aa),K.isDev||_||!ak||!ap||av||(0,k.d)(a.headers);let aC={...E,tree:H,pages:I,GlobalError:D(),handler:L,routeModule:K,__next_app__:J};X&&Y&&(0,o.setReferenceManifestsSingleton)({page:G,clientReferenceManifest:Y,serverActionsManifest:X,serverModuleMap:(0,q.createServerModuleMap)({serverActionsManifest:X})});let aD=a.method||"GET",aE=(0,g.getTracer)(),aF=aE.getActiveScopeSpan();try{let f=K.getVaryHeader(aa,ae);b.setHeader("Vary",f);let k=async(c,d)=>{let e=new l.NodeNextRequest(a),f=new l.NodeNextResponse(b);return K.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=aE.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${aD} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${aD} ${a.url}`)})},m=async({span:e,postponed:f,fallbackRouteParams:g})=>{let i={query:Q,params:R,page:ag,sharedContext:{buildId:P},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aC,Component:(0,j.T)(aC),params:R,routeModule:K,page:G,postponed:f,shouldWaitOnAllReady:az,serveStreamingMetadata:ax,supportsDynamicResponse:"string"==typeof f||ay,buildManifest:U,nextFontManifest:V,reactLoadableManifest:W,subresourceIntegrityManifest:Z,serverActionsManifest:X,clientReferenceManifest:Y,setIsrStatus:null==ac?void 0:ac.setIsrStatus,dir:c(33873).join(process.cwd(),K.relativeProjectDir),isDraftMode:_,isRevalidate:ak&&!f&&!av,botType:am,isOnDemandRevalidate:ah,isPossibleServerAction:aq,assetPrefix:ad.assetPrefix,nextConfigOutput:ad.output,crossOrigin:ad.crossOrigin,trailingSlash:ad.trailingSlash,previewProps:$.preview,deploymentId:ad.deploymentId,enableTainting:ad.experimental.taint,htmlLimitedBots:ad.htmlLimitedBots,devtoolSegmentExplorer:ad.experimental.devtoolSegmentExplorer,reactMaxHeadersLength:ad.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:ad.experimental.cacheLife,basePath:ad.basePath,serverActions:ad.experimental.serverActions,...as?{nextExport:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isRevalidate:!0,isDebugDynamicAccesses:as}:{},experimental:{isRoutePPREnabled:ar,expireTime:ad.expireTime,staleTimes:ad.experimental.staleTimes,cacheComponents:!!ad.experimental.cacheComponents,clientSegmentCache:!!ad.experimental.clientSegmentCache,clientParamParsing:!!ad.experimental.clientParamParsing,dynamicOnHover:!!ad.experimental.dynamicOnHover,inlineCss:!!ad.experimental.inlineCss,authInterrupts:!!ad.experimental.authInterrupts,clientTraceMetadata:ad.experimental.clientTraceMetadata||[]},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d)=>K.onRequestError(a,b,d,ac),err:(0,h.getRequestMeta)(a,"invokeError"),dev:K.isDev}},l=await k(e,i),{metadata:m}=l,{cacheControl:n,headers:o={},fetchTags:p}=m;if(p&&(o[y.NEXT_CACHE_TAGS_HEADER]=p),a.fetchMetrics=m.fetchMetrics,ak&&(null==n?void 0:n.revalidate)===0&&!K.isDev&&!ar){let a=m.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${aa}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""} see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:v.CachedRouteKind.APP_PAGE,html:l,headers:o,rscData:m.flightData,postponed:m.postponed,status:m.statusCode,segmentData:m.segmentData},cacheControl:n}},o=async({hasResolved:c,previousCacheEntry:f,isRevalidating:g,span:i})=>{let j,k=!1===K.isDev,l=c||b.writableEnded;if(ah&&ab&&!f&&!N)return(null==ac?void 0:ac.render404)?await ac.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(ai&&(j=(0,w.parseFallbackField)(ai.fallback)),j===w.FallbackMode.PRERENDER&&(0,u.isBot)(al)&&(!ar||an)&&(j=w.FallbackMode.BLOCKING_STATIC_RENDER),(null==f?void 0:f.isStale)===-1&&(ah=!0),ah&&(j!==w.FallbackMode.NOT_FOUND||f)&&(j=w.FallbackMode.BLOCKING_STATIC_RENDER),!N&&j!==w.FallbackMode.BLOCKING_STATIC_RENDER&&aB&&!l&&!_&&T&&(k||!aj)){let b;if((k||ai)&&j===w.FallbackMode.NOT_FOUND)throw new B.NoFallbackError;if(ar&&!ap){let c="string"==typeof(null==ai?void 0:ai.fallback)?ai.fallback:k?ag:null;if(b=await K.handleResponse({cacheKey:c,req:a,nextConfig:ad,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:$,isRoutePPREnabled:ar,responseGenerator:async()=>m({span:i,postponed:void 0,fallbackRouteParams:k||at?(0,n.u)(ag):null}),waitUntil:d.waitUntil}),null===b)return null;if(b)return delete b.cacheControl,b}}let o=ah||g||!au?void 0:au;if(as&&void 0!==o)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:v.CachedRouteKind.PAGES,html:x.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let p=T&&ar&&((0,h.getRequestMeta)(a,"renderFallbackShell")||at)?(0,n.u)(af):null;return m({span:i,postponed:o,fallbackRouteParams:p})},p=async c=>{var f,g,i,j,k;let l,n=await K.handleResponse({cacheKey:aA,responseGenerator:a=>o({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ah,isRoutePPREnabled:ar,req:a,nextConfig:ad,prerenderManifest:$,waitUntil:d.waitUntil});if(_&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),K.isDev&&b.setHeader("Cache-Control","no-store, must-revalidate"),!n){if(aA)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=n.value)?void 0:f.kind)!==v.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=n.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let p="string"==typeof n.value.postponed;ak&&!av&&(!p||ao)&&(N||b.setHeader("x-nextjs-cache",ah?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),b.setHeader(t.NEXT_IS_PRERENDER_HEADER,"1"));let{value:q}=n;if(au)l={revalidate:0,expire:void 0};else if(N&&ap&&!ao&&ar)l={revalidate:0,expire:void 0};else if(!K.isDev)if(_)l={revalidate:0,expire:void 0};else if(ak){if(n.cacheControl)if("number"==typeof n.cacheControl.revalidate){if(n.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${n.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});l={revalidate:n.cacheControl.revalidate,expire:(null==(j=n.cacheControl)?void 0:j.expire)??ad.expireTime}}else l={revalidate:y.CACHE_ONE_YEAR,expire:void 0}}else b.getHeader("Cache-Control")||(l={revalidate:0,expire:void 0});if(n.cacheControl=l,"string"==typeof aw&&(null==q?void 0:q.kind)===v.CachedRouteKind.APP_PAGE&&q.segmentData){b.setHeader(t.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=q.headers)?void 0:k[y.NEXT_CACHE_TAGS_HEADER];N&&ak&&c&&"string"==typeof c&&b.setHeader(y.NEXT_CACHE_TAGS_HEADER,c);let d=q.segmentData.get(aw);return void 0!==d?(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:x.default.fromStatic(d,t.RSC_CONTENT_TYPE_HEADER),cacheControl:n.cacheControl}):(b.statusCode=204,(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:x.default.EMPTY,cacheControl:n.cacheControl}))}let r=(0,h.getRequestMeta)(a,"onCacheEntry");if(r&&await r({...n,value:{...n.value,kind:"PAGE"}},{url:(0,h.getRequestMeta)(a,"initURL")}))return null;if(p&&au)throw Object.defineProperty(Error("Invariant: postponed state should not be present on a resume request"),"__NEXT_ERROR_CODE",{value:"E396",enumerable:!1,configurable:!0});if(q.headers){let a={...q.headers};for(let[c,d]of(N&&ak||delete a[y.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let s=null==(g=q.headers)?void 0:g[y.NEXT_CACHE_TAGS_HEADER];if(N&&ak&&s&&"string"==typeof s&&b.setHeader(y.NEXT_CACHE_TAGS_HEADER,s),!q.status||ap&&ar||(b.statusCode=q.status),!N&&q.status&&F.RedirectStatusCode[q.status]&&ap&&(b.statusCode=200),p&&b.setHeader(t.NEXT_DID_POSTPONE_HEADER,"1"),ap&&!_){if(void 0===q.rscData){if(q.postponed)throw Object.defineProperty(Error("Invariant: Expected postponed to be undefined"),"__NEXT_ERROR_CODE",{value:"E372",enumerable:!1,configurable:!0});return(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:q.html,cacheControl:av?{revalidate:0,expire:void 0}:n.cacheControl})}return(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:x.default.fromStatic(q.rscData,t.RSC_CONTENT_TYPE_HEADER),cacheControl:n.cacheControl})}let u=q.html;if(!p||N||ap)return(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:u,cacheControl:n.cacheControl});if(as)return u.push(new ReadableStream({start(a){a.enqueue(z.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:u,cacheControl:{revalidate:0,expire:void 0}});let w=new TransformStream;return u.push(w.readable),m({span:c,postponed:q.postponed,fallbackRouteParams:null}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==v.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(w.writable)}).catch(a=>{w.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:u,cacheControl:{revalidate:0,expire:void 0}})};if(!aF)return await aE.withPropagatedContext(a.headers,()=>aE.trace(i.BaseServerSpan.handleRequest,{spanName:`${aD} ${a.url}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aD,"http.target":a.url}},p));await p(aF)}catch(b){throw b instanceof B.NoFallbackError||await K.onRequestError(a,b,{routerKind:"App Router",routePath:G,routeType:"render",revalidateReason:(0,f.c)({isRevalidate:ak,isOnDemandRevalidate:ah})},ac),b}}},33873:a=>{"use strict";a.exports=require("path")},34631:a=>{"use strict";a.exports=require("tls")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},44972:(a,b,c)=>{"use strict";c.d(b,{Ez:()=>g,V:()=>f});var d=c(78157),e=c(31768);function f(a){if(!a)return!1;let b=a.trim();return b.startsWith("http://")||b.startsWith("https://")||b.startsWith("/")}function g({icon:a,alt:b="",className:c,fallback:g="\uD83D\uDCE6"}){let h=(a||"").trim(),[i,j]=(0,e.useState)(!1),k=(0,e.useMemo)(()=>f(h)?h.startsWith("/api/")?`https://api.canhelp.gr${h}`:h:"",[h]),l="/category-icons/package.svg";return f(h)?i&&h!==l?(0,d.jsx)("img",{src:l,alt:b,className:c,loading:"lazy",onError:()=>j(!0)}):i&&h===l?(0,d.jsx)("span",{className:c,children:g}):(0,d.jsx)("img",{src:k,alt:b,className:c,loading:"lazy",onError:()=>j(!0)}):(0,d.jsx)("span",{className:c,children:h||g})}},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74075:a=>{"use strict";a.exports=require("zlib")},74303:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>w});var d=c(78157),e=c(31768),f=c(71159),g=c(94496),h=c.n(g),i=c(13260),j=c(96484),k=c(91864),l=c(48178),m=c(8293),n=c(44972);let o={registration_success:["userName","link","siteName","siteUrl"],email_verification:["userName","link","siteName","siteUrl"],password_reset:["userName","link","siteName","siteUrl"],new_offer:["userName","taskTitle","taskId","specialistName","price","link"],new_task:["userName","taskTitle","taskId","customerName","link"],offer_accepted:["userName","taskTitle","price","link"],new_message:["userName","senderName","preview","link"],offer_declined:["userName","taskTitle","taskId","link"],offer_other_accepted:["userName","taskTitle","taskId","link"],task_updated:["userName","taskTitle","taskId","link"],deadline_reminder:["userName","taskTitle","taskId","link"],task_archived:["userName","taskTitle","taskId","link"],referral_reward:["userName","days","planName","link"],plan_activated:["userName","planName","price","expiresAt","link"],plan_upgraded:["userName","oldPlanName","newPlanName","charged","expiresAt","link"],plan_downgrade_scheduled:["userName","currentPlanName","newPlanName","scheduledDate","link"],plan_downgrade_applied:["userName","planName","link"],plan_renewal_reminder:["userName","planName","amount","expiresAt","link"],plan_insufficient_funds:["userName","currentPlanName","requiredAmount","currentBalance","expiresAt","topUpLink"]},p=Array.from(new Set(Object.values(o).flat())),q=[{value:"/category-icons/repairs.svg",label:"Repairs & Construction"},{value:"/category-icons/repairs-alt-wrench.svg",label:"Repairs Alt: Wrench"},{value:"/category-icons/repairs-alt-hard-hat.svg",label:"Repairs Alt: Hard Hat"},{value:"/category-icons/cleaning.svg",label:"Cleaning"},{value:"/category-icons/cleaning-alt-broom.svg",label:"Cleaning Alt: Broom"},{value:"/category-icons/cleaning-alt-sparkles.svg",label:"Cleaning Alt: Sparkles"},{value:"/category-icons/moving.svg",label:"Moving & Transport"},{value:"/category-icons/moving-alt-bus.svg",label:"Moving Alt: Bus"},{value:"/category-icons/moving-alt-train.svg",label:"Moving Alt: Train"},{value:"/category-icons/tutoring.svg",label:"Tutoring & Education"},{value:"/category-icons/tutoring-alt-book-open.svg",label:"Tutoring Alt: Book Open"},{value:"/category-icons/tutoring-alt-notebook.svg",label:"Tutoring Alt: Notebook"},{value:"/category-icons/it.svg",label:"IT & Technology"},{value:"/category-icons/it-alt-monitor.svg",label:"IT Alt: Monitor"},{value:"/category-icons/it-alt-settings.svg",label:"IT Alt: Settings"},{value:"/category-icons/design.svg",label:"Design"},{value:"/category-icons/design-alt-brush.svg",label:"Design Alt: Brush"},{value:"/category-icons/design-alt-paintbrush.svg",label:"Design Alt: Paintbrush"},{value:"/category-icons/beauty.svg",label:"Beauty & Health"},{value:"/category-icons/beauty-alt-heart.svg",label:"Beauty Alt: Heart"},{value:"/category-icons/beauty-alt-stethoscope.svg",label:"Beauty Alt: Stethoscope"},{value:"/category-icons/tech-repair.svg",label:"Device Repair"},{value:"/category-icons/tech-repair-alt-smartphone.svg",label:"Device Repair Alt: Smartphone"},{value:"/category-icons/tech-repair-alt-wrench.svg",label:"Device Repair Alt: Wrench"},{value:"/category-icons/events.svg",label:"Events"},{value:"/category-icons/events-alt-calendar.svg",label:"Events Alt: Calendar"},{value:"/category-icons/events-alt-clock.svg",label:"Events Alt: Clock"},{value:"/category-icons/photo-video.svg",label:"Photo & Video"},{value:"/category-icons/photo-video-alt-image.svg",label:"Photo & Video Alt: Image"},{value:"/category-icons/photo-video-alt-video.svg",label:"Photo & Video Alt: Video"},{value:"/category-icons/pets.svg",label:"Pets"},{value:"/category-icons/pets-alt-dog.svg",label:"Pets Alt: Dog"},{value:"/category-icons/pets-alt-cat.svg",label:"Pets Alt: Cat"},{value:"/category-icons/auto.svg",label:"Automotive"},{value:"/category-icons/auto-alt-carfront.svg",label:"Automotive Alt: Car Front"},{value:"/category-icons/auto-alt-car.svg",label:"Automotive Alt: Car"},{value:"/category-icons/legal.svg",label:"Legal Services"},{value:"/category-icons/legal-alt-gavel.svg",label:"Legal Alt: Gavel"},{value:"/category-icons/legal-alt-landmark.svg",label:"Legal Alt: Landmark"},{value:"/category-icons/accounting.svg",label:"Accounting"},{value:"/category-icons/accounting-alt-receipt.svg",label:"Accounting Alt: Receipt"},{value:"/category-icons/accounting-alt-wallet.svg",label:"Accounting Alt: Wallet"},{value:"/category-icons/other.svg",label:"Other"},{value:"/category-icons/other-alt-briefcase.svg",label:"Other Alt: Briefcase"},{value:"/category-icons/other-alt-search.svg",label:"Other Alt: Search"}];function r(a,b){return a?"en"===b?a.namesEn||a.namesEl||a.slug||"":"ru"===b?a.namesRu||a.namesEl||a.slug||"":"uk"===b?a.namesUk||a.namesEl||a.slug||"":a.namesEl||a.namesEn||a.slug||"":""}function s(a,b){return a?"en"===b?a.nameEn||a.nameEl||a.slug||"":"ru"===b?a.nameRu||a.nameEl||a.slug||"":"uk"===b?a.nameUk||a.nameEl||a.slug||"":a.nameEl||a.nameEn||a.slug||"":""}function t({value:a,onChange:b,onUpload:c,uploading:e,error:f,presets:g}){return(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 rounded-xl border border-gray-200 bg-white px-3 py-2",children:[(0,d.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-lg bg-green-50",children:(0,d.jsx)(n.Ez,{icon:a,alt:"category icon",className:"h-9 w-9 object-contain text-3xl leading-none",fallback:"\uD83D\uDCE6"})}),(0,d.jsx)("input",{value:a,onChange:a=>b(a.target.value),className:"flex-1 border-0 bg-transparent p-0 text-sm outline-none ring-0",placeholder:"/category-icons/package.svg"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("label",{className:`inline-flex cursor-pointer items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition ${e?"border-gray-200 bg-gray-100 text-gray-400":"border-green-300 bg-green-50 text-green-700 hover:bg-green-100"}`,children:[e?"Uploading...":"Upload SVG",(0,d.jsx)("input",{type:"file",accept:".svg,image/svg+xml",className:"hidden",disabled:e,onChange:async a=>{let b=a.target.files?.[0];b&&(await c(b),a.target.value="")}})]}),(0,d.jsx)("span",{className:"text-xs text-gray-500",children:"or choose from presets"})]}),(0,d.jsx)("p",{className:"text-[11px] text-gray-500",children:"Preset source: /public/category-icons/presets.json"}),f?(0,d.jsx)("p",{className:"text-xs text-red-600",children:f}):null,(0,d.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4",children:g.map(c=>{let e=a===c.value;return(0,d.jsxs)("button",{type:"button",onClick:()=>b(c.value),className:`flex h-20 flex-col items-center justify-center gap-1 rounded-lg border px-2 transition ${e?"border-green-500 bg-green-50 shadow-sm":"border-gray-200 bg-white hover:border-green-300 hover:bg-green-50"}`,"aria-label":c.label,title:c.label,children:[(0,d.jsx)(n.Ez,{icon:c.value,alt:c.label,className:"h-8 w-8 object-contain text-3xl leading-none",fallback:"\uD83D\uDCE6"}),(0,d.jsx)("span",{className:"max-w-full truncate text-[11px] font-medium text-gray-600 leading-tight",children:c.label})]},c.value)})})]})}function u({catRows:a,locale:b,selected:c,onAdd:f,addLabel:g}){let[h,i]=(0,e.useState)(!1),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)(null),o=(0,e.useRef)(null),p=a.filter(a=>!a.parentId),q=j.toLowerCase(),s=a=>!j||r(a,b).toLowerCase().includes(q)||(a.slug??"").toLowerCase().includes(q);return(0,d.jsxs)("div",{className:"relative",ref:o,children:[(0,d.jsxs)("button",{type:"button",onClick:()=>i(a=>!a),className:`w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ${h?"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,d.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,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 10h16M4 14h16M4 18h16"})}),(0,d.jsx)("span",{className:"flex-1 text-left truncate",children:g}),(0,d.jsx)("svg",{className:`w-3 h-3 text-gray-400 shrink-0 transition-transform ${h?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),h&&(0,d.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,d.jsx)("div",{className:"sticky top-0 bg-white px-3 py-2 border-b border-gray-100",children:(0,d.jsx)("input",{autoFocus:!0,value:j,onChange:a=>k(a.target.value),placeholder:"Поиск...",className:"w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300"})}),p.map(e=>{let g=a.filter(a=>a.parentId===e.id),h=r(e,b),o=l===e.id,p=g.filter(a=>!c.includes(a.slug)&&s(a)),q=!c.includes(e.slug)&&s(e),t=g.length>0;return!q&&0===p.length&&j?null:(0,d.jsxs)("div",{children:[(0,d.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:()=>{t&&!j?m(o?null:e.id):q&&(f(e.slug),i(!1),k(""))},children:[e.icon?(0,d.jsx)(n.Ez,{icon:e.icon,alt:h,className:"h-5 w-5 shrink-0 object-contain text-sm leading-none",fallback:"\uD83D\uDCE6"}):null,(0,d.jsx)("span",{className:"flex-1 font-medium",children:h}),t&&!j?(0,d.jsx)("svg",{className:`w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${o?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}):null]}),(o||!!j)&&p.map(a=>(0,d.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:()=>{f(a.slug),i(!1),k("")},children:[(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0"}),(0,d.jsx)("span",{className:"flex-1",children:r(a,b)})]},a.id))]},e.id)})]})]})}function v({locRows:a,locale:b,selected:c,onAdd:f,addLabel:g}){let[h,i]=(0,e.useState)(!1),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)(null),n=(0,e.useRef)(null),o=a.filter(a=>!a.parentId),p=j.toLowerCase(),q=a=>!j||s(a,b).toLowerCase().includes(p)||(a.slug??"").toLowerCase().includes(p);return(0,d.jsxs)("div",{className:"relative",ref:n,children:[(0,d.jsxs)("button",{type:"button",onClick:()=>i(a=>!a),className:`w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ${h?"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,d.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,d.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,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),(0,d.jsx)("span",{className:"flex-1 text-left truncate",children:g}),(0,d.jsx)("svg",{className:`w-3 h-3 text-gray-400 shrink-0 transition-transform ${h?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),h&&(0,d.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,d.jsx)("div",{className:"sticky top-0 bg-white px-3 py-2 border-b border-gray-100",children:(0,d.jsx)("input",{autoFocus:!0,value:j,onChange:a=>k(a.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"})}),o.map(e=>{let g=a.filter(a=>a.parentId===e.id),h=s(e,b),n=l===e.id,o=g.length>0,p=g.filter(a=>!c.includes(a.slug)&&q(a)),r=!c.includes(e.slug)&&q(e);return!r&&0===p.length&&j?null:(0,d.jsxs)("div",{children:[(0,d.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:()=>{o&&!j?m(n?null:e.id):r&&(f(e.slug),i(!1),k(""))},children:[(0,d.jsx)("svg",{className:"w-3 h-3 text-gray-300 shrink-0",fill:"currentColor",viewBox:"0 0 24 24",children:(0,d.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,d.jsx)("span",{className:"flex-1 font-medium",children:h}),o&&!j?(0,d.jsx)("svg",{className:`w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${n?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}):null]}),(n||!!j)&&p.map(a=>(0,d.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:()=>{f(a.slug),i(!1),k("")},children:[(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0"}),(0,d.jsx)("span",{className:"flex-1",children:s(a,b)})]},a.id))]},e.id)})]})]})}function w(){(0,f.useRouter)();let{data:a,isPending:b}=(0,i.wV)(),{t:c,locale:g}=(0,j.Y)(),[n,w]=(0,e.useState)("stats"),[A,B]=(0,e.useState)(!1),[C,F]=(0,e.useState)(null),[I,J]=(0,e.useState)([]),[L,M]=(0,e.useState)(1),[N,O]=(0,e.useState)(0),[P,Q]=(0,e.useState)(""),[R,S]=(0,e.useState)(""),[T,U]=(0,e.useState)(""),[V,W]=(0,e.useState)([]),[X,Y]=(0,e.useState)(1),[Z,$]=(0,e.useState)(0),[_,aa]=(0,e.useState)(""),[ab,ac]=(0,e.useState)(""),[ad,ae]=(0,e.useState)(""),[af,ag]=(0,e.useState)([]),[ah,ai]=(0,e.useState)(1),[aj,ak]=(0,e.useState)(0),[al,am]=(0,e.useState)(0),[an,ao]=(0,e.useState)([]),[ap,aq]=(0,e.useState)(1),[ar,as]=(0,e.useState)(0),[at,au]=(0,e.useState)(!1),[av,aw]=(0,e.useState)(0),[ax,ay]=(0,e.useState)({}),[az,aA]=(0,e.useState)({}),[aB,aC]=(0,e.useState)(null),[aD,aE]=(0,e.useState)([]),[aF,aG]=(0,e.useState)(1),[aH,aI]=(0,e.useState)(0),[aJ,aK]=(0,e.useState)(""),[aL,aM]=(0,e.useState)(""),[aN,aO]=(0,e.useState)(""),[aP,aQ]=(0,e.useState)(""),[aR,aS]=(0,e.useState)(null),[aT,aU]=(0,e.useState)(""),[aV,aW]=(0,e.useState)(!1),[aX,aY]=(0,e.useState)([]),[aZ,a$]=(0,e.useState)(1),[a_,a0]=(0,e.useState)(0),[a1,a2]=(0,e.useState)([]),[a3,a4]=(0,e.useState)(0),[a5,a6]=(0,e.useState)(1),[a7,a8]=(0,e.useState)(""),[a9,ba]=(0,e.useState)(""),[bb,bc]=(0,e.useState)(""),[bd,be]=(0,e.useState)(""),[bf,bg]=(0,e.useState)([]),[bh,bi]=(0,e.useState)([]),[bj,bk]=(0,e.useState)(0),[bl,bm]=(0,e.useState)(1),[bn,bo]=(0,e.useState)(""),[bp,bq]=(0,e.useState)(""),[br,bs]=(0,e.useState)(""),[bt,bu]=(0,e.useState)([]),[bv,bw]=(0,e.useState)("ai"),[bx,by]=(0,e.useState)([]),[bz,bA]=(0,e.useState)(1),[bB,bC]=(0,e.useState)(0),[bD,bE]=(0,e.useState)(""),[bF,bG]=(0,e.useState)([]),[bH,bI]=(0,e.useState)(""),[bJ,bK]=(0,e.useState)(""),[bL,bM]=(0,e.useState)([]),[bN,bO]=(0,e.useState)([]),[bP,bQ]=(0,e.useState)([]),[bR,bS]=(0,e.useState)(0),[bT,bU]=(0,e.useState)(1),[bV,bW]=(0,e.useState)(""),[bX,bY]=(0,e.useState)(""),[bZ,b$]=(0,e.useState)(!1),[b_,b0]=(0,e.useState)(!1),[b1,b2]=(0,e.useState)(null),[b3,b4]=(0,e.useState)(!1),[b5,b6]=(0,e.useState)(!1),[b7,b8]=(0,e.useState)("profile"),[b9,ca]=(0,e.useState)(null),[cb,cc]=(0,e.useState)(""),[cd,ce]=(0,e.useState)([]),[cf,cg]=(0,e.useState)(!1),[ch,ci]=(0,e.useState)({}),[cj,ck]=(0,e.useState)({}),[cl,cm]=(0,e.useState)({}),[cn,co]=(0,e.useState)({}),[cp,cq]=(0,e.useState)([]),[cr,cs]=(0,e.useState)(null),[ct,cu]=(0,e.useState)(!1),[cv,cw]=(0,e.useState)([]),[cx,cy]=(0,e.useState)(null),[cz,cA]=(0,e.useState)(!1),[cB,cC]=(0,e.useState)(new Set),[cD,cE]=(0,e.useState)([]),[cF,cG]=(0,e.useState)(null),[cH,cI]=(0,e.useState)(!1),[cJ,cK]=(0,e.useState)(new Set),[cL,cM]=(0,e.useState)(!1),[cN,cO]=(0,e.useState)(null),[cP,cQ]=(0,e.useState)(q),[cR,cS]=(0,e.useState)(new Set),[cT,cU]=(0,e.useState)({}),[cV,cW]=(0,e.useState)(new Set),[cX,cY]=(0,e.useState)(null),[cZ,c$]=(0,e.useState)(!1),[c_,c0]=(0,e.useState)("general"),[c1,c2]=(0,e.useState)({siteName:"CanHelp",siteUrl:"",contactEmail:"",supportPhone:"",showPricing:!0}),[c3,c4]=(0,e.useState)(!1),[c5,c6]=(0,e.useState)(!1),[c7,c8]=(0,e.useState)({host:"",port:"587",username:"",password:"",fromName:"CanHelp",fromEmail:"",encryption:"tls"}),[c9,da]=(0,e.useState)(!1),[db,dc]=(0,e.useState)(!1),[dd,de]=(0,e.useState)(!1),[df,dg]=(0,e.useState)(null),[dh,di]=(0,e.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:'<h2 style="margin:0 0 8px;color:#111827;font-size:20px">Ваше предложение принято! \uD83C\uDF89</h2><p style="color:#6b7280;margin:0 0 20px">Привет, {{userName}}!</p><p style="color:#374151">Заказчик принял ваше предложение на выполнение задачи:</p><div style="background:#f0fdf4;border:1px solid #bbf7d0;border-radius:8px;padding:16px;margin:16px 0"><p style="margin:0;color:#1e40af;font-weight:600">{{taskTitle}}</p><p style="margin:4px 0 0;color:#374151">Сумма: <strong>{{price}}€</strong></p></div><a href="{{link}}" style="display:inline-block;background:#2563eb;color:#fff;text-decoration:none;padding:12px 24px;border-radius:8px;font-weight:600;margin-top:8px">Открыть чат →</a>'},new_message:{subject:"Новое сообщение от {{senderName}}",body:'<h2 style="margin:0 0 8px;color:#111827;font-size:20px">Новое сообщение</h2><p style="color:#6b7280;margin:0 0 20px">Привет, {{userName}}!</p><p style="color:#374151">Вам написал(а) <strong>{{senderName}}</strong>:</p><div style="background:#f9fafb;border-left:4px solid #2563eb;padding:16px;margin:16px 0"><p style="margin:0;color:#374151;font-style:italic">"{{preview}}"</p></div><a href="{{link}}" style="display:inline-block;background:#2563eb;color:#fff;text-decoration:none;padding:12px 24px;border-radius:8px;font-weight:600;margin-top:8px">Ответить →</a>'},offer_declined:{subject:"Ваше предложение отклонено: {{taskTitle}}",body:'<h2 style="margin:0 0 8px;color:#111827;font-size:20px">Ваше предложение отклонено</h2><p style="color:#6b7280;margin:0 0 20px">Привет, {{userName}}!</p><p style="color:#374151">К сожалению, заказчик отклонил ваше предложение на:</p><div style="background:#fef2f2;border:1px solid #fecaca;border-radius:8px;padding:16px;margin:16px 0"><p style="margin:0;color:#b91c1c;font-weight:600">{{taskTitle}}</p></div><a href="{{link}}" style="display:inline-block;background:#2563eb;color:#fff;text-decoration:none;padding:12px 24px;border-radius:8px;font-weight:600;margin-top:8px">Найти другие заказы →</a>'},offer_other_accepted:{subject:"Выбран другой исполнитель: {{taskTitle}}",body:'<h2 style="margin:0 0 8px;color:#111827;font-size:20px">Выбран другой исполнитель</h2><p style="color:#6b7280;margin:0 0 20px">Привет, {{userName}}!</p><p style="color:#374151">Заказчик выбрал другого исполнителя для задания:</p><div style="background:#fff7ed;border:1px solid #fed7aa;border-radius:8px;padding:16px;margin:16px 0"><p style="margin:0;color:#c2410c;font-weight:600">{{taskTitle}}</p></div><a href="{{link}}" style="display:inline-block;background:#2563eb;color:#fff;text-decoration:none;padding:12px 24px;border-radius:8px;font-weight:600;margin-top:8px">Найти другие заказы →</a>'},task_updated:{subject:"Задание обновлено: {{taskTitle}}",body:'<h2 style="margin:0 0 8px;color:#111827;font-size:20px">Задание обновлено</h2><p style="color:#6b7280;margin:0 0 20px">Привет, {{userName}}!</p><p style="color:#374151">Заказчик обновил детали задания:</p><div style="background:#eff6ff;border:1px solid #bfdbfe;border-radius:8px;padding:16px;margin:16px 0"><p style="margin:0;color:#1d4ed8;font-weight:600">{{taskTitle}}</p></div><a href="{{link}}" style="display:inline-block;background:#2563eb;color:#fff;text-decoration:none;padding:12px 24px;border-radius:8px;font-weight:600;margin-top:8px">Смотреть заказ →</a>'},deadline_reminder:{subject:"Задание истекает завтра: {{taskTitle}}",body:'<h2 style="margin:0 0 8px;color:#111827;font-size:20px">Напоминание о дедлайне</h2><p style="color:#6b7280;margin:0 0 20px">Привет, {{userName}}!</p><p style="color:#374151">Ваше задание истекает через 24 часа. Обновите дедлайн, иначе задание будет автоматически снято с публикации.</p><div style="background:#fefce8;border:1px solid #fde68a;border-radius:8px;padding:16px;margin:16px 0"><p style="margin:0;color:#92400e;font-weight:600">{{taskTitle}}</p></div><a href="{{link}}" style="display:inline-block;background:#2563eb;color:#fff;text-decoration:none;padding:12px 24px;border-radius:8px;font-weight:600;margin-top:8px">Редактировать задание →</a>'},task_archived:{subject:"Задание снято с публикации: {{taskTitle}}",body:'<h2 style="margin:0 0 8px;color:#111827;font-size:20px">Задание переведено в черновик</h2><p style="color:#6b7280;margin:0 0 20px">Привет, {{userName}}!</p><p style="color:#374151">Ваше задание истекло и было автоматически переведено в черновик. Обновите дедлайн, чтобы опубликовать его снова.</p><div style="background:#fef2f2;border:1px solid #fecaca;border-radius:8px;padding:16px;margin:16px 0"><p style="margin:0;color:#b91c1c;font-weight:600">{{taskTitle}}</p></div><a href="{{link}}" style="display:inline-block;background:#2563eb;color:#fff;text-decoration:none;padding:12px 24px;border-radius:8px;font-weight:600;margin-top:8px">Редактировать задание →</a>'},referral_reward:{subject:"Вы получили реферальную награду — {{siteName}}",body:'<h2 style="margin:0 0 8px;color:#111827;font-size:20px">Вы получили реферальную награду! \uD83C\uDF81</h2><p style="color:#6b7280;margin:0 0 20px">Привет, {{userName}}!</p><p style="color:#374151">Друг зарегистрировался по вашей реферальной ссылке. На ваш аккаунт добавлено <strong>{{days}} дней</strong> доступа к плану <strong>{{planName}}</strong>!</p><div style="background:#f0fdf4;border:1px solid #bbf7d0;border-radius:8px;padding:16px;margin:16px 0"><p style="margin:0;color:#15803d;font-weight:600">+{{days}} дней — {{planName}}</p></div><a href="{{link}}" style="display:inline-block;background:#2563eb;color:#fff;text-decoration:none;padding:12px 24px;border-radius:8px;font-weight:600;margin-top:8px">Перейти к аккаунту →</a>'},referral_reward_el:{subject:"Λάβατε ανταμοιβή παραπομπής — {{siteName}}",body:'<h2 style="margin:0 0 8px;color:#111827;font-size:20px">Λάβατε ανταμοιβή παραπομπής! \uD83C\uDF81</h2><p style="color:#6b7280;margin:0 0 20px">Γεια {{userName}},</p><p style="color:#374151">Ένας φίλος εγγράφηκε χρησιμοποιώντας τον σύνδεσμο παραπομπής σας. Στον λογαριασμό σας προστέθηκαν <strong>{{days}} ημέρες</strong> πρόσβασης στο πλάνο <strong>{{planName}}</strong>!</p><div style="background:#f0fdf4;border:1px solid #bbf7d0;border-radius:8px;padding:16px;margin:16px 0"><p style="margin:0;color:#15803d;font-weight:600">+{{days}} ημέρες — {{planName}}</p></div><a href="{{link}}" style="display:inline-block;background:#2563eb;color:#fff;text-decoration:none;padding:12px 24px;border-radius:8px;font-weight:600;margin-top:8px">Δες τον λογαριασμό σου →</a>'},referral_reward_en:{subject:"You received a referral reward — {{siteName}}",body:'<h2 style="margin:0 0 8px;color:#111827;font-size:20px">You received a referral reward! \uD83C\uDF81</h2><p style="color:#6b7280;margin:0 0 20px">Hi {{userName}},</p><p style="color:#374151">A friend registered using your referral link. <strong>{{days}} days</strong> of <strong>{{planName}}</strong> access have been added to your account!</p><div style="background:#f0fdf4;border:1px solid #bbf7d0;border-radius:8px;padding:16px;margin:16px 0"><p style="margin:0;color:#15803d;font-weight:600">+{{days}} days — {{planName}}</p></div><a href="{{link}}" style="display:inline-block;background:#2563eb;color:#fff;text-decoration:none;padding:12px 24px;border-radius:8px;font-weight:600;margin-top:8px">View your account →</a>'},referral_reward_ru:{subject:"Вы получили реферальную награду — {{siteName}}",body:'<h2 style="margin:0 0 8px;color:#111827;font-size:20px">Вы получили реферальную награду! \uD83C\uDF81</h2><p style="color:#6b7280;margin:0 0 20px">Привет, {{userName}}!</p><p style="color:#374151">Друг зарегистрировался по вашей реферальной ссылке. На ваш аккаунт добавлено <strong>{{days}} дней</strong> доступа к плану <strong>{{planName}}</strong>!</p><div style="background:#f0fdf4;border:1px solid #bbf7d0;border-radius:8px;padding:16px;margin:16px 0"><p style="margin:0;color:#15803d;font-weight:600">+{{days}} дней — {{planName}}</p></div><a href="{{link}}" style="display:inline-block;background:#2563eb;color:#fff;text-decoration:none;padding:12px 24px;border-radius:8px;font-weight:600;margin-top:8px">Перейти к аккаунту →</a>'}}),[dj,dk]=(0,e.useState)(null),[dl,dm]=(0,e.useState)("el"),[dn,dp]=(0,e.useState)(!1),[dq,dr]=(0,e.useState)(!1),[ds,dt]=(0,e.useState)({merchantId:"",apiUser:"",apiPassword:"",environment:"test",confirmationUrl:"",cancelUrl:"",enabled:!1}),[du,dv]=(0,e.useState)(!1),[dw,dx]=(0,e.useState)(!1),[dy,dz]=(0,e.useState)({enabled:!1,planId:"",days:"30"}),[dA,dB]=(0,e.useState)(!1),[dC,dD]=(0,e.useState)(!1),[dE,dF]=(0,e.useState)({maintenanceMode:!1,indexingEnabled:!0,headScripts:"",siteTitleEl:"",siteTitleEn:"",siteTitleRu:"",siteTitleUk:"",siteDescriptionEl:"",siteDescriptionEn:"",siteDescriptionRu:"",siteDescriptionUk:""}),[dG,dH]=(0,e.useState)(!1),[dI,dJ]=(0,e.useState)(!1),[dK,dL]=(0,e.useState)("el"),[dM,dN]=(0,e.useState)({telegram:"",instagram:"",facebook:"",twitter:"",youtube:"",tiktok:"",whatsapp:"",viber:""}),[dO,dP]=(0,e.useState)(!1),[dQ,dR]=(0,e.useState)(!1),[dS,dT]=(0,e.useState)({botToken:"",adminChatId:"",channelIdEl:"",channelIdEn:"",channelIdRu:"",channelIdUk:"",notifyRegistrations:!1,postNewTasks:!1}),[dU,dV]=(0,e.useState)(!1),[dW,dX]=(0,e.useState)(!1),[dY,dZ]=(0,e.useState)(!1),[d$,d_]=(0,e.useState)(!1),[d0,d1]=(0,e.useState)(null),[d2,d3]=(0,e.useState)(null),[d4,d5]=(0,e.useState)(null),[d6,d7]=(0,e.useState)({}),[d8,d9]=(0,e.useState)(!1),[ea,eb]=(0,e.useState)(null),[ec,ed]=(0,e.useState)(!1),[ee,ef]=(0,e.useState)(!1),[eg,eh]=(0,e.useState)([]),[ei,ej]=(0,e.useState)(!1),[ek,el]=(0,e.useState)([]),[em,en]=(0,e.useState)(!1),[eo,ep]=(0,e.useState)(null),[eq,er]=(0,e.useState)(null),[es,et]=(0,e.useState)(null),[eu,ev]=(0,e.useState)(!1),ew=a=>{et(a),ev(!1)},ex=a=>{et(a),ev(!0)},[ey,ez]=(0,e.useState)(null),[eA,eB]=(0,e.useState)(!1),[eC,eD]=(0,e.useState)("uk"),[eE,eF]=(0,e.useState)("el"),[eG,eH]=(0,e.useState)({}),[eI,eJ]=(0,e.useState)(null),[eK,eL]=(0,e.useState)(null),[eM,eN]=(0,e.useState)(null),[eO,eP]=(0,e.useState)(!1),[eQ,eR]=(0,e.useState)(new Set),[eS,eT]=(0,e.useState)("broadcast"),[eU,eV]=(0,e.useState)(""),[eW,eX]=(0,e.useState)(""),[eY,eZ]=(0,e.useState)(""),[e$,e_]=(0,e.useState)("general"),[e0,e1]=(0,e.useState)(""),[e2,e3]=(0,e.useState)(!0),[e4,e5]=(0,e.useState)(!1),[e6,e7]=(0,e.useState)(null),[e8,e9]=(0,e.useState)(null),[fa,fb]=(0,e.useState)(!1);async function fc(){if(eW.trim()){if("user"===eS&&!eU.trim())return void e9("Укажите ID пользователя");e5(!0),e9(null),e7(null);try{let a={title:eW.trim(),body:eY.trim()||void 0,type:e$.trim()||void 0,referenceId:e0.trim()||void 0};if("broadcast"===eS){let b=await k.V7({...a,onlyActive:e2});e7(b)}else{let b=await k.g1(eU.trim(),a);e7(b)}}catch(a){e9(a?.message||"Не удалось отправить push")}finally{e5(!1)}}}async function fd(a,b){let c=b?k.Wi:k.He,d=await c(a).catch(()=>null);d&&J(b=>b.map(b=>b.id===a?d:b))}function fe(a,b){return a?"THIRD_PARTY_AUTH_ERROR"===a?"Ошибка APNs/Firebase iOS: проверьте Apple APNs Auth Key (.p8) и связку Firebase проекта для iOS-приложения":"UNREGISTERED"===a?"Токен устройства больше не валиден":"INVALID_ARGUMENT"===a?"Некорректный токен или payload":"REQUEST_FAILED"===a?b||"FCM request failed before response":b?`${a}: ${b}`:a:b||"FCM принял 0 сообщений"}async function ff(){if(b1){b4(!0);try{let a=await k.wl(b1.id,{firstName:b1.firstName,lastName:b1.lastName,phone:b1.phone||null,bio:b1.bio||null,role:b1.role,planId:b1.planId||null,isActive:b1.isActive,locale:b1.locale,languages:b1.languages??[],personalSiteSlug:b1.personalSiteSlug||null,showContactInfo:b1.showContactInfo??!1,notifyNewTasks:b1.notifyNewTasks??!1,notifMessages:b1.notifMessages??!0,skills:b1.skills??[],siteSettings:b1.siteSettings??{}});await Promise.all(cd.map(a=>k.oq(a.id,{title:a.title,description:a.description||null,skills:a.skills??[],categories:a.categories??[],locations:a.locations??[],publicationStatus:a.publicationStatus,isActive:a.isActive}).catch(()=>null))),J(b=>b.map(b=>b.id===b1.id?a:b)),b2(null)}catch{}finally{b4(!1)}}}async function fg(){if(b1){b6(!0);try{let a=await k.uQ(b1.id);b2(b=>b?{...b,emailVerified:a.emailVerified}:b),J(b=>b.map(b=>b.id===b1.id?{...b,emailVerified:a.emailVerified}:b))}catch{}finally{b6(!1)}}}async function fh(){if(!b1)return;let a=Number(b1.topUpAmount);if(a&&!(a<=0)){b$(!0);try{let b=await k.P0(b1.id,{amount:a,description:b1.topUpDescription||void 0});J(a=>a.map(a=>a.id===b1.id?b.user:a)),b2(a=>a?{...a,...b.user,topUpAmount:"",topUpDescription:""}:a),"balances"===n&&k.g0({page:bT,userId:bV||void 0,kind:bX||void 0}).then(a=>{bQ(a.data),bS(a.total)}).catch(()=>{})}catch{}finally{b$(!1)}}}async function fi(){if(!b1)return;let a=Number(b1.withdrawAmount);if(a&&!(a<=0)){b0(!0);try{let b=await k.hD(b1.id,{amount:a,description:b1.withdrawDescription||void 0});J(a=>a.map(a=>a.id===b1.id?b.user:a)),b2(a=>a?{...a,...b.user,withdrawAmount:"",withdrawDescription:""}:a),"balances"===n&&k.g0({page:bT,userId:bV||void 0,kind:bX||void 0}).then(a=>{bQ(a.data),bS(a.total)}).catch(()=>{})}catch{}finally{b0(!1)}}}async function fj(a){let b=cd.find(b=>b.id===a);if(b){ck(b=>({...b,[a]:!0}));try{let c=await k.oq(a,{title:b.title,description:b.description||null,skills:b.skills??[],categories:b.categories??[],locations:b.locations??[],publicationStatus:b.publicationStatus,isActive:b.isActive});ce(b=>b.map(b=>b.id===a?c:b))}catch{}finally{ck(b=>({...b,[a]:!1}))}}}async function fk(a,b){let c=await k.oq(a,{publicationStatus:b,isActive:"active"===b}).catch(()=>null);c&&(ao(b=>b.map(b=>b.id===a?c:b)),b1?.id===c.specialistId&&ce(b=>b.map(b=>b.id===a?c:b)),k.z5(1,"pending").then(a=>am(a.total)).catch(()=>{}),k.s_(1,"pending").then(a=>aw(a.total)).catch(()=>{}))}async function fl(a,b,c){let d=ax[b.id],e=az[b.id];("map"!==c||d)&&("create"!==c||e?.trim())&&(aC(b.id),await k.M6(a,b.id,{action:c,..."map"===c?{categoryId:d}:{},..."create"===c?{slug:e.trim()}:{}}).catch(()=>null)&&ao(f=>f.map(f=>f.id===a?{...f,categorySuggestions:(f.categorySuggestions??[]).filter(a=>a.id!==b.id),..."reject"!==c?{categories:[...new Set([...f.categories??[],"map"===c?cD.find(a=>a.id===d)?.slug:e.trim()])]}:{}}:f)),aC(null))}async function fm(a){let b=await k.nf(a).catch(()=>null);if(b){let c=b.task||b;W(b=>b.map(b=>(b.task||b).id===a?{...b,task:c}:b))}}async function fn(a,b){window.confirm(`${c("admin.tasks.delete.confirm")} "${b}"`)&&await k.GB(a).catch(()=>null)&&W(b=>b.filter(b=>(b.task?.id||b.id)!==a))}async function fo(a,b){let c=await k.eU(a,b).catch(()=>null);c&&ag(b=>b.map(b=>b.id===a?{...b,...c}:b))}function fp(a){cy({parentId:a??null,slug:"",nameEl:"",nameEn:"",nameRu:"",nameUk:"",order:0,isActive:!0})}async function fq(){if(cx){cA(!0);try{if(cx.id){let a=await k.Nt(cx.id,cx);cw(b=>b.map(b=>b.id===cx.id?a:b))}else{let a=await k.yJ({slug:cx.slug,nameEl:cx.nameEl,nameEn:cx.nameEn,nameRu:cx.nameRu,nameUk:cx.nameUk,parentId:cx.parentId,order:cx.order});cw(b=>[...b,a])}cy(null)}catch{}finally{cA(!1)}}}async function fr(a,b){window.confirm(`${c("admin.loc.delete.confirm")} "${b}"`)&&await k.zR(a).catch(()=>null)&&cw(b=>b.filter(b=>b.id!==a))}function fs(a){cO(null),cG({parentId:a??null,slug:"",icon:"/category-icons/package.svg",namesEl:"",namesEn:"",namesRu:"",namesUk:"",order:0,isActive:!0})}async function ft(a){if("image/svg+xml"!==a.type)return void cO("Only SVG files are allowed");cM(!0),cO(null);try{let b=new FormData;b.append("file",a);let c=await fetch("https://api.canhelp.gr/api/uploads",{method:"POST",credentials:"include",body:b});if(!c.ok){let a=await c.json().catch(()=>({error:"Upload failed"}));throw Error(a.error||"Upload failed")}let d=await c.json();cG(a=>a?{...a,icon:d.url}:a)}catch(a){cO(a?.message||"Upload failed")}finally{cM(!1)}}async function fu(){if(cF){cI(!0);try{if(cF.id){let a=await k.$7(cF.id,cF);cE(b=>b.map(b=>b.id===cF.id?a:b))}else{let a=await k.zZ({slug:cF.slug,icon:cF.icon,namesEl:cF.namesEl,namesEn:cF.namesEn,namesRu:cF.namesRu,namesUk:cF.namesUk,parentId:cF.parentId,order:cF.order});cE(b=>[...b,a])}cG(null)}catch{}finally{cI(!1)}}}async function fv(a,b){window.confirm(`${c("admin.cat.delete.confirm")} "${b}"`)&&await k.K7(a).catch(()=>null)&&cE(b=>b.filter(b=>b.id!==a))}async function fw(a){let b=a.id,c=a.slug;if(cS(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c}),!cT[c]){cW(a=>new Set(a).add(b));try{let a=await k.i_(c);cU(b=>({...b,[c]:a}))}catch{}finally{cW(a=>{let c=new Set(a);return c.delete(b),c})}}}async function fx(){if(cX){c$(!0);try{if(cX.id){let a=await k.fP(cX.id,{nameEl:cX.nameEl,nameEn:cX.nameEn,nameRu:cX.nameRu,nameUk:cX.nameUk,order:cX.order});cU(b=>({...b,[cX.catSlug]:(b[cX.catSlug]??[]).map(b=>b.id===cX.id?a:b)}))}else{let a=await k.S9({categorySlug:cX.catSlug,nameEl:cX.nameEl,nameEn:cX.nameEn,nameRu:cX.nameRu,nameUk:cX.nameUk,order:cX.order});cU(b=>({...b,[cX.catSlug]:[...b[cX.catSlug]??[],a]}))}cY(null)}catch{}finally{c$(!1)}}}async function fy(a,b){(a._skipConfirm||window.confirm(`Удалить навык "${a.nameEl}"?`))&&(a._skipConfirm||await k.hp(a.id).catch(()=>null))&&cU(c=>({...c,[b]:(c[b]??[]).filter(b=>b.id!==a.id)}))}async function fz(){if(cr){cu(!0);try{let a={name:cr.name,description:cr.description||void 0,role:cr.role,tier:cr.tier,price:cr.price,oldPrice:cr.oldPrice||null,currency:cr.currency,maxTasks:cr.maxTasks?Number(cr.maxTasks):null,maxOffers:cr.maxOffers?Number(cr.maxOffers):null,maxCards:cr.maxCards?Number(cr.maxCards):null,maxMessagesPerDay:cr.maxMessagesPerDay?Number(cr.maxMessagesPerDay):null,maxOrdersPerDay:cr.maxOrdersPerDay?Number(cr.maxOrdersPerDay):null,maxSkills:cr.maxSkills?Number(cr.maxSkills):null,durationDays:cr.durationDays?Number(cr.durationDays):null,notifyNewTasks:cr.notifyNewTasks,searchBoost:cr.searchBoost,offersMultiplier:cr.offersMultiplier,canContactFreePlan:cr.canContactFreePlan,canContactProPlan:cr.canContactProPlan,canContactAll:cr.canContactAll,canShowContactInfo:cr.canShowContactInfo,canViewPhone:cr.canViewPhone,canUploadVideo:cr.canUploadVideo,hasFavorites:cr.hasFavorites,hasGoogleCalendar:cr.hasGoogleCalendar,hasVerifiedBadge:cr.hasVerifiedBadge,highlightedReviews:cr.highlightedReviews,hasPersonalSite:cr.hasPersonalSite,hasCanHelpNowStatus:cr.hasCanHelpNowStatus,hasNeedHelpStatus:cr.hasNeedHelpStatus,hasAutoResponse:cr.hasAutoResponse,hasAutoMatch:cr.hasAutoMatch,hasPriceList:cr.hasPriceList,receiveInstantDispatchFree:cr.receiveInstantDispatchFree,receiveInstantDispatchPro:cr.receiveInstantDispatchPro,features:cr.features?cr.features.split("\n").map(a=>a.trim()).filter(Boolean):[],isDefault:cr.isDefault,isActive:cr.isActive,order:cr.order};if(cr.id){let b=await k.td(cr.id,a);cq(a=>a.map(a=>a.id===cr.id?b:a))}else{let b=await k.qT(a);cq(a=>[...a,b])}cr.isDefault&&k.OX().then(cq).catch(()=>{}),cs(null)}catch{}finally{cu(!1)}}}async function fA(a,b){window.confirm(`Delete plan "${b}"?`)&&await k.bR(a).catch(()=>null)&&cq(b=>b.filter(b=>b.id!==a))}async function fB(){c4(!0);try{await k.CX({"general.siteName":c1.siteName,"general.siteUrl":c1.siteUrl,"general.contactEmail":c1.contactEmail,"general.supportPhone":c1.supportPhone,"general.showPricing":String(c1.showPricing)}),c6(!0),setTimeout(()=>c6(!1),2500)}catch{}finally{c4(!1)}}async function fC(){da(!0);try{await k.CX({"smtp.host":c7.host,"smtp.port":c7.port,"smtp.username":c7.username,"smtp.password":c7.password,"smtp.fromName":c7.fromName,"smtp.fromEmail":c7.fromEmail,"smtp.encryption":c7.encryption}),dc(!0),setTimeout(()=>dc(!1),2500)}catch{}finally{da(!1)}}async function fD(a){let b=`${a}_${dl}`,c=dh[b]??dh[a]??{subject:"",body:""};if(c.subject||c.body){dr(!0);try{await k.jg(b,c);let d=await k.wc({subject:c.subject,body:c.body,fromLocale:dl});di(e=>{let f={...e,[b]:c};for(let[b,c]of Object.entries(d))f[`${a}_${b}`]=c;return f}),await Promise.all(Object.entries(d).map(([b,c])=>k.jg(`${a}_${b}`,c)))}catch{}finally{dr(!1)}}}async function fE(a){let b=`${a}_${dl}`;dp(!0);try{await k.jg(b,dh[b]??{subject:"",body:""}),dk(null)}catch{}finally{dp(!1)}}async function fF(){dv(!0);try{await k.CX({"payment.epay.merchantId":ds.merchantId,"payment.epay.apiUser":ds.apiUser,"payment.epay.apiPassword":ds.apiPassword,"payment.epay.environment":ds.environment,"payment.epay.confirmationUrl":ds.confirmationUrl,"payment.epay.cancelUrl":ds.cancelUrl,"payment.epay.enabled":String(ds.enabled)}),dx(!0),setTimeout(()=>dx(!1),2500)}catch{}finally{dv(!1)}}async function fG(){dB(!0);try{await k.CX({referral_enabled:String(dy.enabled),referral_plan_id:dy.planId,referral_days:dy.days}),dD(!0),setTimeout(()=>dD(!1),2500)}catch{}finally{dB(!1)}}async function fH(){dH(!0);try{await k.CX({"seo.maintenanceMode":String(dE.maintenanceMode),"seo.indexingEnabled":String(dE.indexingEnabled),"seo.headScripts":dE.headScripts,"seo.siteTitle.el":dE.siteTitleEl,"seo.siteTitle.en":dE.siteTitleEn,"seo.siteTitle.ru":dE.siteTitleRu,"seo.siteTitle.uk":dE.siteTitleUk,"seo.siteDescription.el":dE.siteDescriptionEl,"seo.siteDescription.en":dE.siteDescriptionEn,"seo.siteDescription.ru":dE.siteDescriptionRu,"seo.siteDescription.uk":dE.siteDescriptionUk}),dJ(!0),setTimeout(()=>dJ(!1),2500)}catch{}finally{dH(!1)}}async function fI(){dP(!0);try{await k.CX({"social.telegram":dM.telegram,"social.instagram":dM.instagram,"social.facebook":dM.facebook,"social.twitter":dM.twitter,"social.youtube":dM.youtube,"social.tiktok":dM.tiktok,"social.whatsapp":dM.whatsapp,"social.viber":dM.viber}),dR(!0),setTimeout(()=>dR(!1),2500)}catch{}finally{dP(!1)}}async function fJ(){dV(!0);try{await k.CX({"telegram.botToken":dS.botToken,"telegram.adminChatId":dS.adminChatId,"telegram.channelId.el":dS.channelIdEl,"telegram.channelId.en":dS.channelIdEn,"telegram.channelId.ru":dS.channelIdRu,"telegram.channelId.uk":dS.channelIdUk,"telegram.notifyRegistrations":String(dS.notifyRegistrations),"telegram.postNewTasks":String(dS.postNewTasks)}),dX(!0),setTimeout(()=>dX(!1),2500)}catch{}finally{dV(!1)}}async function fK(a){let b={admin:dS.adminChatId,el:dS.channelIdEl,en:dS.channelIdEn,ru:dS.channelIdRu,uk:dS.channelIdUk}[a]??"";"admin"===a?(dZ(!0),d1(null)):(d5(a),d7(b=>{let c={...b};return delete c[a],c}));try{let d=await k.qX(dS.botToken,b),e={ok:d.ok,msg:d.ok?d.botName?`@${d.botName}`:c("admin.settings.telegram.test_ok"):d.error??c("admin.settings.telegram.test_fail")};"admin"===a?d1(e):d7(b=>({...b,[a]:e}))}catch{let b={ok:!1,msg:c("admin.settings.telegram.test_fail")};"admin"===a?d1(b):d7(c=>({...c,[a]:b}))}finally{"admin"===a?dZ(!1):d5(null)}}async function fL(){d9(!0),eb(null);try{let a=await k.cl(dS.botToken);eb({ok:a.ok,msg:a.ok?`@${a.botName}`:a.error??c("admin.settings.telegram.test_fail")})}catch{eb({ok:!1,msg:c("admin.settings.telegram.test_fail")})}finally{d9(!1)}}if(!b&&a&&a.user?.role,b)return(0,d.jsx)("div",{className:"text-center py-20 text-gray-500",children:c("common.loading")});let fM="ru"===g?"ru-RU":"en"===g?"en-US":"el-GR",fN=[{key:"stats",label:c("admin.tab.stats"),icon:(0,d.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.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:c("admin.tab.users"),icon:(0,d.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"}),(0,d.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,d.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:c("admin.tab.tasks"),icon:(0,d.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.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:c("admin.tab.reports"),badge:al||void 0,icon:(0,d.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})},{key:"moderation",label:c("admin.tab.moderation"),badge:av||void 0,icon:(0,d.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8c-1.1 0-2 .9-2 2v1H9a1 1 0 00-1 1v5a1 1 0 001 1h6a1 1 0 001-1v-5a1 1 0 00-1-1h-1v-1c0-1.1-.9-2-2-2zm0 0V6m0 12v-2"}),(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 20h12"})]})},{key:"categories",label:c("admin.tab.categories"),icon:(0,d.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.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:c("admin.tab.locations"),icon:(0,d.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,d.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,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]})},{key:"balances",label:c("admin.tab.balances","Balance"),icon:(0,d.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,d.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,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 12h-6m0 0a2 2 0 100 4h6v-8h-6a2 2 0 100 4z"})]})},{key:"plans",label:c("admin.tab.plans"),icon:(0,d.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,d.jsx)("rect",{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2"}),(0,d.jsx)("line",{x1:"1",y1:"10",x2:"23",y2:"10"})]})},{key:"logs",label:c("admin.tab.logs"),icon:(0,d.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,d.jsx)("polyline",{points:"4 17 10 11 4 5"}),(0,d.jsx)("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})},{key:"settings",label:c("admin.tab.settings"),icon:(0,d.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,d.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:c("admin.tab.support","Support"),icon:(0,d.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.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:c("admin.tab.push","Push"),icon:(0,d.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.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:c("admin.tab.backup","Backup"),icon:(0,d.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.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:c("admin.tab.translations","Translations"),icon:(0,d.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.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:c("admin.tab.dbcheck","DB check"),icon:(0,d.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,d.jsx)("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12c0 1.66-4.03 3-9 3S3 13.66 3 12"}),(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5"}),(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4"})]})},{key:"referrals",label:c("admin.tab.referrals","Referrals"),icon:(0,d.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.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"})})}],fO={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"},fP={pending:"bg-yellow-100 text-yellow-700",reviewed:"bg-green-100 text-green-700",dismissed:"bg-gray-100 text-gray-500"},fQ={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"},fR=a=>a.publicationStatus??(a.isActive?"active":"inactive"),fS=an.filter(a=>"pending"===fR(a)),fT=an.filter(a=>"active"===fR(a));return(0,d.jsx)("div",{className:"min-h-screen bg-gray-50",children:(0,d.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-8",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("svg",{className:"w-7 h-7 text-yellow-500",fill:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm0 3a1 1 0 000 2h14a1 1 0 000-2H5z"})}),(0,d.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:c("admin.title")})]}),(0,d.jsxs)(h(),{href:"/",className:"flex items-center gap-1.5 text-sm text-gray-500 hover:text-green-600 transition",children:[(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),c("admin.back_home")]})]}),(0,d.jsxs)("div",{className:"flex gap-6",children:[(0,d.jsx)("aside",{className:`shrink-0 transition-all duration-200 ${A?"w-12":"w-52"}`,children:(0,d.jsxs)("nav",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,d.jsx)("button",{type:"button",onClick:()=>B(a=>!a),title:A?"Развернуть меню":"Свернуть меню",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,d.jsx)("svg",{className:`w-4 h-4 transition-transform duration-200 ${A?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})})}),fN.map(({key:a,label:b,icon:c,badge:e})=>(0,d.jsxs)("button",{onClick:()=>w(a),title:A?b:void 0,className:`w-full flex items-center py-3 text-sm font-medium text-left transition ${n===a?"bg-green-50 text-green-700 border-r-2 border-green-600":"text-gray-600 hover:bg-gray-50 hover:text-gray-900"} ${A?"justify-center px-3":"gap-3 px-4"}`,children:[(0,d.jsx)("span",{className:"w-4 h-4 flex-shrink-0 flex items-center justify-center",children:c}),!A&&(0,d.jsxs)("span",{className:"flex items-center gap-2 min-w-0",children:[(0,d.jsx)("span",{children:b}),e?(0,d.jsx)("span",{className:"ml-auto inline-flex min-w-5 h-5 items-center justify-center rounded-full bg-red-100 px-1.5 text-[11px] font-semibold text-red-700",children:e}):null]})]},a))]})}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:["stats"===n&&(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4",children:[{label:c("admin.stats.users"),value:C?.userCount,icon:(0,d.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,d.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:c("admin.stats.specialists"),value:C?.specialistCount,icon:(0,d.jsxs)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[(0,d.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,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),color:"text-purple-600"},{label:c("admin.stats.tasks"),value:C?.taskCount,icon:(0,d.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,d.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:c("admin.stats.offers"),value:C?.offerCount,icon:(0,d.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,d.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:c("admin.stats.reviews"),value:C?.reviewCount,icon:(0,d.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,d.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(({label:a,value:b,icon:c,color:e})=>(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,d.jsx)("div",{className:`mb-2 ${e}`,children:c}),(0,d.jsx)("div",{className:`text-3xl font-bold ${e}`,children:b??"—"}),(0,d.jsx)("div",{className:"text-sm text-gray-500 mt-1",children:a})]},a))}),C?.tasksByDay&&(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsx)("h2",{className:"font-semibold text-gray-800",children:c("admin.stats.activity_30d")}),(0,d.jsxs)("div",{className:"flex gap-4 text-xs text-gray-500",children:[(0,d.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"w-3 h-0.5 bg-green-500 inline-block rounded"}),c("admin.stats.users_label")]}),(0,d.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"w-3 h-0.5 bg-purple-400 inline-block rounded"}),c("admin.stats.specialists_label")]}),(0,d.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"w-3 h-0.5 bg-green-500 inline-block rounded"}),c("admin.stats.tasks_label")]})]})]}),(0,d.jsx)(K,{series:[{data:C.usersByDay,color:"#3b82f6",fill:"#3b82f615",label:c("admin.stats.users_label")},{data:C.specialistsByDay,color:"#a855f7",fill:"#a855f710",label:c("admin.stats.specialists_label")},{data:C.tasksByDay,color:"#22c55e",fill:"#22c55e10",label:c("admin.stats.tasks_label")}]})]}),C?.tasksByStatus&&(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,d.jsx)("h2",{className:"font-semibold text-gray-800 mb-5",children:c("admin.stats.tasks_by_status")}),(0,d.jsx)("div",{className:"space-y-3",children:(()=>{let a=C.tasksByStatus.reduce((a,b)=>a+Number(b.count),0)||1,b={open:{label:c("admin.task_status.open"),bg:"bg-green-50",bar:"bg-green-500"},in_progress:{label:c("admin.task_status.in_progress"),bg:"bg-green-50",bar:"bg-green-500"},completed:{label:c("admin.task_status.completed"),bg:"bg-gray-50",bar:"bg-gray-400"},cancelled:{label:c("admin.task_status.cancelled"),bg:"bg-red-50",bar:"bg-red-400"},draft:{label:c("admin.task_status.draft"),bg:"bg-yellow-50",bar:"bg-yellow-400"}},e=["open","in_progress","completed","draft","cancelled"];return[...C.tasksByStatus].sort((a,b)=>e.indexOf(a.status)-e.indexOf(b.status)).map(({status:c,count:e})=>{let f=b[c]??{label:c,bg:"bg-gray-50",bar:"bg-gray-300"},g=Math.round(Number(e)/a*100);return(0,d.jsxs)("div",{className:`flex items-center gap-3 px-3 py-2 rounded-lg ${f.bg}`,children:[(0,d.jsx)("span",{className:"text-sm text-gray-600 w-28 shrink-0",children:f.label}),(0,d.jsx)("div",{className:"flex-1 bg-gray-200 rounded-full h-2 overflow-hidden",children:(0,d.jsx)("div",{className:`h-full rounded-full ${f.bar} transition-all`,style:{width:`${g}%`}})}),(0,d.jsx)("span",{className:"text-sm font-semibold text-gray-700 w-8 text-right",children:e}),(0,d.jsxs)("span",{className:"text-xs text-gray-400 w-8",children:[g,"%"]})]},c)})})()})]}),bL.length>0&&(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsx)("h2",{className:"font-semibold text-gray-800",children:c("admin.stats.notif_chart_title")}),(0,d.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[(0,d.jsx)("span",{className:"w-3 h-0.5 bg-orange-500 inline-block rounded"}),c("admin.stats.notif_label")]})]}),(0,d.jsx)(K,{series:[{data:bL,color:"#f97316",fill:"#f9731615",label:c("admin.stats.notif_label")}]})]}),bN.length>0&&(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsx)("h2",{className:"font-semibold text-gray-800",children:c("admin.stats.mail_chart_title")}),(0,d.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[(0,d.jsx)("span",{className:"w-3 h-0.5 bg-sky-500 inline-block rounded"}),c("admin.stats.mail_label")]})]}),(0,d.jsx)(K,{series:[{data:bN,color:"#0ea5e9",fill:"#0ea5e915",label:c("admin.stats.mail_label")}]})]}),C&&(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 space-y-5",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("h2",{className:"font-semibold text-gray-800",children:c("admin.stats.tokens_title")}),(0,d.jsxs)("div",{className:"flex gap-4 text-xs text-gray-500",children:[(0,d.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"w-3 h-0.5 bg-violet-500 inline-block rounded"}),c("admin.stats.tokens_out")]}),(0,d.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"w-3 h-0.5 bg-sky-500 inline-block rounded"}),c("admin.stats.tokens_in")]})]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,d.jsxs)("div",{className:"rounded-lg bg-violet-50 border border-violet-100 px-4 py-3",children:[(0,d.jsx)("div",{className:"text-xs text-violet-600 mb-1",children:c("admin.stats.tokens_out_label")}),(0,d.jsx)("div",{className:"text-2xl font-bold text-violet-700",children:Number(C.totalOutputTokens).toLocaleString()})]}),(0,d.jsxs)("div",{className:"rounded-lg bg-sky-50 border border-sky-100 px-4 py-3",children:[(0,d.jsx)("div",{className:"text-xs text-sky-600 mb-1",children:c("admin.stats.tokens_in_label")}),(0,d.jsx)("div",{className:"text-2xl font-bold text-sky-700",children:Number(C.totalInputTokens).toLocaleString()})]}),(0,d.jsxs)("div",{className:"rounded-lg bg-emerald-50 border border-emerald-100 px-4 py-3",children:[(0,d.jsx)("div",{className:"text-xs text-emerald-600 mb-1",children:c("admin.stats.cost_label")}),(0,d.jsxs)("div",{className:"text-2xl font-bold text-emerald-700",children:["$",Number(C.totalCostUsd??0).toFixed(4)]})]})]}),C.tokensByMonth?.length>0&&(0,d.jsx)(H,{dateLocale:fM,series:[{data:C.tokensByMonth.map(a=>({month:a.month,count:Number(a.output)})),color:"#8b5cf6",fill:"#8b5cf610",label:c("admin.stats.tokens_out_label")},{data:C.tokensByMonth.map(a=>({month:a.month,count:Number(a.input)})),color:"#0ea5e9",fill:"#0ea5e915",label:c("admin.stats.tokens_in_label")}]})]})]}),"users"===n&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex gap-3 mb-4",children:[(0,d.jsxs)("form",{className:"flex gap-2 flex-1",onSubmit:a=>{a.preventDefault(),Q(R)},children:[(0,d.jsx)("input",{value:R,onChange:a=>S(a.target.value),placeholder:c("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,d.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:c("tasks.search.btn")})]}),(0,d.jsxs)("select",{value:T,onChange:a=>U(a.target.value),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,d.jsx)("option",{value:"",children:c("admin.filter.all_roles")}),(0,d.jsx)("option",{value:"user",children:c("admin.user_edit.role.user")}),(0,d.jsx)("option",{value:"admin",children:c("profile.role.admin")})]})]}),(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,d.jsxs)("table",{className:"w-full text-sm",children:[(0,d.jsx)("thead",{className:"bg-gray-50 text-left",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:c("admin.col.user")}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:c("admin.col.email")}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:c("admin.col.role")}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:c("admin.col.plan","Plan")}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:c("admin.col.registered")}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:c("admin.col.status")}),(0,d.jsx)("th",{className:"px-4 py-3"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-gray-100",children:fa?(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:c("common.loading")})}):0===I.length?(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:"—"})}):I.map(a=>(0,d.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,d.jsx)("td",{className:"px-4 py-3 font-medium text-gray-800",children:(0,l.H)(a.firstName,a.lastName,a.name)}),(0,d.jsx)("td",{className:"px-4 py-3 text-gray-500",children:a.email}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsx)("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${"admin"===a.role?"bg-red-100 text-red-700":"specialist"===a.role?"bg-green-100 text-green-700":"bg-gray-100 text-gray-600"}`,children:c(`profile.role.${a.role}`)||a.role})}),(0,d.jsx)("td",{className:"px-4 py-3 text-gray-400 text-xs",children:a.planId?cp.find(b=>b.id===a.planId)?.name??(0,d.jsxs)("span",{className:"font-mono",children:[a.planId.slice(0,8),"…"]}):(0,d.jsx)("span",{className:"text-gray-300",children:"—"})}),(0,d.jsx)("td",{className:"px-4 py-3 text-gray-400",children:new Date(a.createdAt).toLocaleDateString(fM)}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsx)("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${!1!==a.isActive?"bg-green-100 text-green-700":"bg-red-100 text-red-600"}`,children:!1!==a.isActive?c("admin.users.active"):c("admin.users.inactive")})}),(0,d.jsx)("td",{className:"px-4 py-3 text-right",children:(0,d.jsxs)("div",{className:"flex items-center justify-end gap-1.5",children:[(0,d.jsx)("button",{onClick:()=>{b8("profile"),cc(""),ca(null),ce([]),ci({}),ck({}),cm({}),co({}),b2({...a,topUpAmount:"",topUpDescription:"",withdrawAmount:"",withdrawDescription:""}),k.jd(a.id).then(a=>b2(b=>b&&b.id===a.id?{...a,topUpAmount:"",topUpDescription:"",withdrawAmount:"",withdrawDescription:""}:b)).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,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.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"!==a.role&&(0,d.jsx)("button",{onClick:()=>fd(a.id,!1!==a.isActive),className:`text-xs px-3 py-1 rounded-lg font-medium ${!1!==a.isActive?"bg-red-50 text-red-600 hover:bg-red-100":"bg-green-50 text-green-600 hover:bg-green-100"}`,children:!1!==a.isActive?c("admin.users.deactivate"):c("admin.users.activate")})]})})]},a.id))})]}),(0,d.jsx)(D,{page:L,total:N,limit:20,onChange:M,totalLabel:c("admin.pagination.total")})]})]}),"balances"===n&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex flex-wrap gap-3 mb-4",children:[(0,d.jsx)("input",{value:bV,onChange:a=>bW(a.target.value),placeholder:c("admin.balance.filter.user_id","Filter by 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,d.jsxs)("select",{value:bX,onChange:a=>bY(a.target.value),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,d.jsx)("option",{value:"",children:c("admin.balance.filter.all","All operations")}),(0,d.jsx)("option",{value:"topup",children:c("admin.balance.kind.topup","Top-up")}),(0,d.jsx)("option",{value:"plan_purchase",children:c("admin.balance.kind.plan_purchase","Plan charge")}),(0,d.jsx)("option",{value:"admin_topup",children:c("admin.balance.kind.admin_topup","Admin top-up")}),(0,d.jsx)("option",{value:"admin_adjustment",children:c("admin.balance.kind.admin_adjustment","Adjustment")})]})]}),(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,d.jsxs)("table",{className:"w-full text-sm",children:[(0,d.jsx)("thead",{className:"bg-gray-50 text-left",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:c("admin.col.user")}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:c("admin.balance.col.operation","Operation")}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:c("admin.balance.col.amount","Amount")}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:c("admin.balance.col.result","Balance")}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:c("admin.balance.col.description","Description")}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:c("admin.balance.col.date","Date")})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-gray-100",children:fa?(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:c("common.loading")})}):0===bP.length?(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:c("admin.balance.empty","No records yet")})}):bP.map(a=>{let b="credit"===a.direction,e="topup"===a.kind?c("admin.balance.kind.topup","Top-up"):"plan_purchase"===a.kind?c("admin.balance.kind.plan_purchase","Plan charge"):"admin_topup"===a.kind?c("admin.balance.kind.admin_topup","Admin top-up"):c("admin.balance.kind.admin_adjustment","Adjustment");return(0,d.jsxs)("tr",{className:"hover:bg-gray-50 align-top",children:[(0,d.jsxs)("td",{className:"px-4 py-3",children:[(0,d.jsx)("div",{className:"font-medium text-gray-800",children:a.userName||"—"}),(0,d.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:a.userEmail||a.userId})]}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsx)("span",{className:`inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${b?"bg-emerald-50 text-emerald-700":"bg-rose-50 text-rose-700"}`,children:e})}),(0,d.jsxs)("td",{className:`px-4 py-3 font-semibold ${b?"text-emerald-700":"text-rose-700"}`,children:[b?"+":"-",Number(a.amount).toFixed(2)," ",a.currency]}),(0,d.jsx)("td",{className:"px-4 py-3 text-gray-600",children:(0,d.jsxs)("div",{children:[Number(a.balanceBefore).toFixed(2)," → ",Number(a.balanceAfter).toFixed(2)," ",a.currency]})}),(0,d.jsx)("td",{className:"px-4 py-3 text-gray-500 max-w-sm",children:a.description||"—"}),(0,d.jsx)("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:new Date(a.createdAt).toLocaleString(fM)})]},a.id)})})]}),(0,d.jsx)(D,{page:bT,total:bR,limit:50,onChange:bU,totalLabel:c("admin.pagination.total")})]})]}),"tasks"===n&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex gap-3 mb-4",children:[(0,d.jsxs)("form",{className:"flex gap-2 flex-1",onSubmit:a=>{a.preventDefault(),aa(ab)},children:[(0,d.jsx)("input",{value:ab,onChange:a=>ac(a.target.value),placeholder:c("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,d.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:c("tasks.search.btn")})]}),(0,d.jsxs)("select",{value:ad,onChange:a=>ae(a.target.value),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,d.jsx)("option",{value:"",children:c("admin.filter.all_statuses")}),["open","in_progress","completed","cancelled","draft"].map(a=>(0,d.jsx)("option",{value:a,children:c(`task.status.${a}`,a)},a))]})]}),(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,d.jsxs)("table",{className:"w-full text-sm",children:[(0,d.jsx)("thead",{className:"bg-gray-50 text-left",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:c("admin.col.title")}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:c("admin.col.customer")}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:c("admin.col.status")}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:c("admin.col.budget")}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:c("admin.col.created")}),(0,d.jsx)("th",{className:"px-4 py-3"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-gray-100",children:fa?(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:c("common.loading")})}):0===V.length?(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:"—"})}):V.map(a=>{let b=a.task||a,e=a.customer;return(0,d.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,d.jsx)("td",{className:"px-4 py-3 font-medium text-gray-800 max-w-xs",children:(0,d.jsx)(h(),{href:`/tasks/${b.id}`,className:"hover:text-green-600 truncate block",target:"_blank",children:"en"===g&&b.titleEn||"ru"===g&&b.titleRu||"uk"===g&&b.titleUk||b.titleEl||b.title})}),(0,d.jsx)("td",{className:"px-4 py-3 text-gray-500 text-xs",children:e?.name??"—"}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsx)("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${fO[b.status]??"bg-gray-100 text-gray-600"}`,children:c(`task.status.${b.status}`,b.status)})}),(0,d.jsx)("td",{className:"px-4 py-3 text-gray-500",children:b.budget?`${(0,m.$g)(b.budget)}€`:"—"}),(0,d.jsx)("td",{className:"px-4 py-3 text-gray-400",children:new Date(b.createdAt).toLocaleDateString(fM)}),(0,d.jsx)("td",{className:"px-4 py-3 text-right",children:(0,d.jsxs)("div",{className:"flex gap-1.5 justify-end",children:["cancelled"!==b.status&&"completed"!==b.status&&(0,d.jsx)("button",{onClick:()=>fm(b.id),className:"text-xs px-2.5 py-1 rounded-lg font-medium bg-yellow-50 text-yellow-700 hover:bg-yellow-100",children:c("admin.tasks.cancel")}),(0,d.jsx)("button",{onClick:()=>fn(b.id,"en"===g&&b.titleEn||"ru"===g&&b.titleRu||"uk"===g&&b.titleUk||b.titleEl||b.title),className:"text-xs px-2.5 py-1 rounded-lg font-medium bg-red-50 text-red-600 hover:bg-red-100",children:c("admin.tasks.delete")})]})})]},b.id)})})]}),(0,d.jsx)(D,{page:X,total:Z,limit:20,onChange:Y,totalLabel:c("admin.pagination.total")})]})]}),"categories"===n&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,d.jsx)("p",{className:"text-sm text-gray-500",children:c("admin.cat.hint")}),(0,d.jsxs)("button",{onClick:()=>fs(null),className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700",children:["+ ",c("admin.cat.add_root")]})]}),cF&&(0,d.jsxs)("div",{className:"bg-green-50 border border-green-200 rounded-xl p-5 mb-4",children:[(0,d.jsxs)("h3",{className:"font-semibold text-gray-800 mb-4",children:[cF.id?c("admin.cat.edit"):c("admin.cat.new"),cF.parentId&&(0,d.jsxs)("span",{className:"text-xs text-gray-400 ml-2",children:["(",c("admin.cat.subcategory"),")"]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3 mb-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.cat.slug")}),(0,d.jsx)("input",{value:cF.slug,onChange:a=>cG(b=>b&&{...b,slug:a.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm",placeholder:"e.g. repairs"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.cat.icon")}),(0,d.jsx)(t,{value:cF.icon,onChange:a=>cG(b=>b&&{...b,icon:a}),onUpload:ft,uploading:cL,error:cN,presets:cP})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.cat.order")}),(0,d.jsx)("input",{type:"number",value:cF.order,onChange:a=>cG(b=>b&&{...b,order:Number(a.target.value)}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[c("admin.cat.name_el")," \uD83C\uDDEC\uD83C\uDDF7"]}),(0,d.jsx)("input",{value:cF.namesEl,onChange:a=>cG(b=>b&&{...b,namesEl:a.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[c("admin.cat.name_en")," \uD83C\uDDEC\uD83C\uDDE7"]}),(0,d.jsx)("input",{value:cF.namesEn,onChange:a=>cG(b=>b&&{...b,namesEn:a.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[c("admin.cat.name_ru")," \uD83C\uDDF7\uD83C\uDDFA"]}),(0,d.jsx)("input",{value:cF.namesRu,onChange:a=>cG(b=>b&&{...b,namesRu:a.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[c("admin.cat.name_uk")," \uD83C\uDDFA\uD83C\uDDE6"]}),(0,d.jsx)("input",{value:cF.namesUk,onChange:a=>cG(b=>b&&{...b,namesUk:a.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]})]}),cF.id&&(0,d.jsxs)("label",{className:"flex items-center gap-2 text-sm text-gray-700 mb-3",children:[(0,d.jsx)("input",{type:"checkbox",checked:cF.isActive,onChange:a=>cG(b=>b&&{...b,isActive:a.target.checked})}),c("admin.cat.active")]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{onClick:fu,disabled:cH,className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:cH?c("common.saving"):c("common.save")}),(0,d.jsx)("button",{onClick:()=>cG(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:c("common.cancel")})]})]}),(0,d.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 divide-y divide-gray-100",children:0===cD.length?(0,d.jsx)("div",{className:"px-4 py-8 text-center text-gray-400",children:c("admin.cat.empty")}):(0,d.jsx)(z,{rows:cD,parentId:null,depth:0,locale:g,expanded:cJ,onToggle:function(a){cK(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},onEdit:function(a){let b="string"==typeof a.icon?a.icon:"",c=new Set(cP.map(a=>a.value)),d=b.startsWith("/category-icons/")&&!c.has(b)?"/category-icons/package.svg":b||"/category-icons/package.svg";cO(null),cG({id:a.id,parentId:a.parentId??null,slug:a.slug,icon:d,namesEl:a.namesEl??a.names?.el??"",namesEn:a.namesEn??a.names?.en??"",namesRu:a.namesRu??a.names?.ru??"",namesUk:a.namesUk??a.names?.uk??"",order:a.order??0,isActive:a.isActive??!0})},onDelete:fv,onAddChild:fs,skillsExpanded:cR,skillsCache:cT,skillsLoading:cV,onToggleSkills:fw,skillForm:cX,skillSaving:cZ,onOpenAddSkill:function(a){cY({catSlug:a,nameEl:"",nameEn:"",nameRu:"",nameUk:"",order:0})},onOpenEditSkill:function(a,b){cY({id:a.id,catSlug:b,nameEl:a.nameEl??"",nameEn:a.nameEn??"",nameRu:a.nameRu??"",nameUk:a.nameUk??"",order:a.order??0})},onSaveSkill:fx,onDeleteSkill:fy,onCancelSkillForm:()=>cY(null),onSkillFormChange:cY,t:c})})]}),"locations"===n&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,d.jsx)("p",{className:"text-sm text-gray-500",children:c("admin.loc.hint")}),(0,d.jsxs)("button",{onClick:()=>fp(null),className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700",children:["+ ",c("admin.loc.add_city")]})]}),cx&&(0,d.jsxs)("div",{className:"bg-green-50 border border-green-200 rounded-xl p-5 mb-4",children:[(0,d.jsxs)("h3",{className:"font-semibold text-gray-800 mb-4",children:[cx.id?c("admin.loc.edit"):c("admin.loc.new"),cx.parentId&&(0,d.jsxs)("span",{className:"text-xs text-gray-400 ml-2",children:["(",c("admin.loc.district"),")"]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.cat.slug")}),(0,d.jsx)("input",{value:cx.slug,onChange:a=>cy(b=>b&&{...b,slug:a.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm",placeholder:"e.g. athens-center"})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[c("admin.cat.name_el")," \uD83C\uDDEC\uD83C\uDDF7"]}),(0,d.jsx)("input",{value:cx.nameEl,onChange:a=>cy(b=>b&&{...b,nameEl:a.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[c("admin.cat.name_en")," \uD83C\uDDEC\uD83C\uDDE7"]}),(0,d.jsx)("input",{value:cx.nameEn,onChange:a=>cy(b=>b&&{...b,nameEn:a.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[c("admin.cat.name_ru")," \uD83C\uDDF7\uD83C\uDDFA"]}),(0,d.jsx)("input",{value:cx.nameRu,onChange:a=>cy(b=>b&&{...b,nameRu:a.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[c("admin.cat.name_uk")," \uD83C\uDDFA\uD83C\uDDE6"]}),(0,d.jsx)("input",{value:cx.nameUk,onChange:a=>cy(b=>b&&{...b,nameUk:a.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-4 mb-3",children:[(0,d.jsxs)("div",{className:"w-24",children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.cat.order")}),(0,d.jsx)("input",{type:"number",value:cx.order,onChange:a=>cy(b=>b&&{...b,order:Number(a.target.value)}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),cx.id&&(0,d.jsxs)("label",{className:"flex items-center gap-2 text-sm text-gray-700 mt-4",children:[(0,d.jsx)("input",{type:"checkbox",checked:cx.isActive,onChange:a=>cy(b=>b&&{...b,isActive:a.target.checked})}),c("admin.cat.active")]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{onClick:fq,disabled:cz,className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:cz?c("common.saving"):c("common.save")}),(0,d.jsx)("button",{onClick:()=>cy(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:c("common.cancel")})]})]}),(0,d.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 divide-y divide-gray-100",children:0===cv.length?(0,d.jsx)("div",{className:"px-4 py-8 text-center text-gray-400",children:c("admin.loc.empty")}):(0,d.jsx)(y,{rows:cv,parentId:null,depth:0,locale:g,expanded:cB,onToggle:function(a){cC(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},onEdit:function(a){cy({id:a.id,parentId:a.parentId??null,slug:a.slug,nameEl:a.nameEl??a.names?.el??"",nameEn:a.nameEn??a.names?.en??"",nameRu:a.nameRu??a.names?.ru??"",nameUk:a.nameUk??a.names?.uk??"",order:a.order??0,isActive:a.isActive??!0})},onDelete:fr,onAddChild:fp,t:c})})]}),"reports"===n&&(0,d.jsxs)("div",{className:"space-y-3",children:[fa?(0,d.jsx)("div",{className:"text-center py-10 text-gray-400",children:c("common.loading")}):0===af.length?(0,d.jsx)("div",{className:"text-center py-10 text-gray-400",children:c("admin.reports.none")}):af.map(a=>(0,d.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-wrap mb-2",children:[(0,d.jsx)("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${fP[a.status]??"bg-gray-100 text-gray-500"}`,children:a.status}),(0,d.jsx)("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${fQ[a.reason]??"bg-gray-100 text-gray-600"}`,children:a.reason}),(0,d.jsxs)("span",{className:"text-xs text-gray-400",children:["task"===a.targetType?c("admin.reports.target.task"):c("admin.reports.target.user"),":"," ",a.targetTitle?(0,d.jsx)(h(),{href:"task"===a.targetType?`/tasks/${a.targetId}`:`/users/${a.targetId}`,className:"text-green-600 hover:underline font-medium",target:"_blank",children:a.targetTitle}):(0,d.jsxs)("span",{className:"font-mono",children:["#",a.targetId?.slice(0,8)]})]})]}),a.reporterName&&(0,d.jsxs)("p",{className:"text-xs text-gray-400 mb-1",children:[c("admin.col.reporter"),": ",(0,d.jsx)("span",{className:"font-medium text-gray-600",children:a.reporterName})]}),a.description&&(0,d.jsx)("p",{className:"text-sm text-gray-700",children:a.description}),(0,d.jsx)("p",{className:"text-xs text-gray-400 mt-1.5",children:new Date(a.createdAt).toLocaleString(fM)})]}),"pending"===a.status&&(0,d.jsxs)("div",{className:"flex gap-2 flex-shrink-0",children:[(0,d.jsx)("button",{onClick:()=>fo(a.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:c("admin.reports.reviewed")}),(0,d.jsx)("button",{onClick:()=>fo(a.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:c("admin.reports.dismiss")})]})]})},a.id)),(0,d.jsx)(D,{page:ah,total:aj,limit:20,onChange:ai,totalLabel:c("admin.pagination.total")})]}),"moderation"===n&&(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,d.jsx)("div",{className:"text-sm text-gray-500",children:c("admin.moderation.pending_count","Pending")}),(0,d.jsx)("div",{className:"text-3xl font-bold text-gray-900 mt-1",children:fS.length}),(0,d.jsx)("div",{className:"text-xs text-gray-400 mt-1",children:c("admin.moderation.pending_hint","New proposals waiting for approval")})]}),(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,d.jsx)("div",{className:"text-sm text-gray-500",children:c("admin.moderation.active_count","Active")}),(0,d.jsx)("div",{className:"text-3xl font-bold text-gray-900 mt-1",children:fT.length}),(0,d.jsx)("div",{className:"text-xs text-gray-400 mt-1",children:c("admin.moderation.active_hint","Visible cards that can be blocked")})]})]}),at?(0,d.jsx)("div",{className:"text-center py-10 text-gray-400",children:c("common.loading")}):0===an.length?(0,d.jsx)("div",{className:"text-center py-10 text-gray-400",children:c("admin.moderation.none","No specialist cards found")}):(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"font-semibold text-gray-800 mb-3",children:c("admin.moderation.pending_title","Pending approval")}),(0,d.jsx)("div",{className:"space-y-3",children:0===fS.length?(0,d.jsx)("div",{className:"text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4",children:c("admin.moderation.pending_empty","No pending proposals right now")}):fS.map(a=>(0,d.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:(0,d.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[(0,d.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-700",children:c("admin.moderation.pending","Pending")}),(0,d.jsx)("span",{className:"text-sm font-semibold text-gray-800 truncate",children:a.title})]}),(0,d.jsx)("div",{className:"text-xs text-gray-500 mb-2",children:(0,d.jsx)(h(),{href:`/users/${a.specialistId}`,className:"hover:text-green-600 hover:underline font-medium",children:a.specialistName??a.specialistEmail??a.specialistId})}),a.description&&(0,d.jsx)("p",{className:"text-sm text-gray-700 line-clamp-3",children:a.description}),(a.categorySuggestions??[]).length>0&&(0,d.jsxs)("div",{className:"mt-3 border-t border-amber-100 pt-3 space-y-2",children:[(0,d.jsx)("p",{className:"text-xs font-semibold text-amber-800",children:c("admin.moderation.category_suggestions","Requested categories")}),a.categorySuggestions.map(b=>(0,d.jsxs)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-2.5",children:[(0,d.jsx)("p",{className:"text-xs font-medium text-gray-800",children:b.name}),(0,d.jsxs)("div",{className:"mt-2 grid gap-2 sm:grid-cols-[minmax(0,1fr)_auto_auto]",children:[(0,d.jsxs)("select",{value:ax[b.id]??"",onChange:a=>ay(c=>({...c,[b.id]:a.target.value})),className:"min-w-0 rounded-lg border border-gray-300 bg-white px-2 py-1.5 text-xs text-gray-700",children:[(0,d.jsx)("option",{value:"",children:c("admin.moderation.map_category","Map to existing category")}),cD.map(a=>(0,d.jsx)("option",{value:a.id,children:r(a,g)},a.id))]}),(0,d.jsx)("button",{onClick:()=>fl(a.id,b,"map"),disabled:!ax[b.id]||aB===b.id,className:"rounded-lg bg-green-600 px-2.5 py-1.5 text-xs font-medium text-white disabled:opacity-50",children:c("admin.moderation.map","Map")}),(0,d.jsx)("button",{onClick:()=>fl(a.id,b,"reject"),disabled:aB===b.id,className:"rounded-lg bg-white px-2.5 py-1.5 text-xs font-medium text-gray-600 ring-1 ring-gray-300 disabled:opacity-50",children:c("admin.moderation.reject","Reject")})]}),(0,d.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,d.jsx)("input",{value:az[b.id]??"",onChange:a=>aA(c=>({...c,[b.id]:a.target.value})),placeholder:c("admin.moderation.new_category_slug","New category slug"),className:"min-w-0 flex-1 rounded-lg border border-gray-300 bg-white px-2 py-1.5 text-xs text-gray-700"}),(0,d.jsx)("button",{onClick:()=>fl(a.id,b,"create"),disabled:!az[b.id]?.trim()||aB===b.id,className:"rounded-lg bg-amber-600 px-2.5 py-1.5 text-xs font-medium text-white disabled:opacity-50",children:c("admin.moderation.create_category","Create category")})]})]},b.id))]})]}),(0,d.jsxs)("div",{className:"flex gap-2 flex-shrink-0",children:[(0,d.jsx)("button",{onClick:()=>fk(a.id,"active"),className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-green-600 text-white hover:bg-green-700",children:c("admin.moderation.approve","Approve")}),(0,d.jsx)("button",{onClick:()=>fk(a.id,"inactive"),className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-gray-100 text-gray-700 hover:bg-gray-200",children:c("admin.moderation.block","Block")})]})]})},a.id))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"font-semibold text-gray-800 mb-3",children:c("admin.moderation.active_title","Active cards")}),(0,d.jsx)("div",{className:"space-y-3",children:0===fT.length?(0,d.jsx)("div",{className:"text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4",children:c("admin.moderation.active_empty","No active cards found")}):fT.map(a=>(0,d.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:(0,d.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[(0,d.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700",children:c("admin.moderation.active","Active")}),(0,d.jsx)("span",{className:"text-sm font-semibold text-gray-800 truncate",children:a.title})]}),(0,d.jsx)("div",{className:"text-xs text-gray-500 mb-2",children:(0,d.jsx)(h(),{href:`/users/${a.specialistId}`,className:"hover:text-green-600 hover:underline font-medium",children:a.specialistName??a.specialistEmail??a.specialistId})}),a.description&&(0,d.jsx)("p",{className:"text-sm text-gray-700 line-clamp-3",children:a.description})]}),(0,d.jsx)("button",{onClick:()=>fk(a.id,"inactive"),className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-red-50 text-red-700 hover:bg-red-100",children:c("admin.moderation.block","Block")})]})},a.id))})]}),(0,d.jsx)(D,{page:ap,total:ar,limit:20,onChange:aq,totalLabel:c("admin.pagination.total")})]})]}),"logs"===n&&(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"flex gap-1 bg-gray-100 rounded-xl p-1 mb-5 w-fit",children:[{key:"ai",label:c("admin.logs.subtab.ai")},{key:"activity",label:c("admin.logs.subtab.activity")},{key:"mail",label:c("admin.logs.subtab.mail")},{key:"notifications",label:c("admin.logs.subtab.notifications")}].map(({key:a,label:b})=>(0,d.jsx)("button",{onClick:()=>bw(a),className:`px-4 py-1.5 rounded-lg text-sm font-medium transition-colors ${bv===a?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-700"}`,children:b},a))}),"ai"===bv&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,d.jsxs)("p",{className:"text-sm text-gray-500",children:[c("admin.pagination.total"),": ",a_]}),(0,d.jsxs)("button",{onClick:()=>{a$(1),k.j_(1).then(a=>{aY(a.data),a0(a.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,d.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,d.jsx)("polyline",{points:"23 4 23 10 17 10"}),(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.49 15a9 9 0 11-2.12-9.36L23 10"})]}),c("common.refresh")]})]}),fa?(0,d.jsx)("div",{className:"text-center py-10 text-gray-400",children:c("common.loading")}):0===aX.length?(0,d.jsx)("div",{className:"text-center py-10 text-gray-400",children:c("admin.logs.empty")}):(0,d.jsx)("div",{className:"overflow-x-auto rounded-xl border border-gray-200",children:(0,d.jsxs)("table",{className:"w-full text-sm",children:[(0,d.jsx)("thead",{className:"bg-gray-50 text-gray-500 text-xs uppercase",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-4 py-3 text-left",children:c("admin.logs.date")}),(0,d.jsx)("th",{className:"px-4 py-3 text-left",children:c("admin.logs.provider")}),(0,d.jsx)("th",{className:"px-4 py-3 text-left",children:c("admin.logs.model")}),(0,d.jsx)("th",{className:"px-4 py-3 text-left",children:c("admin.logs.action")}),(0,d.jsx)("th",{className:"px-4 py-3 text-left",children:c("admin.logs.langs")}),(0,d.jsx)("th",{className:"px-4 py-3 text-right",children:c("admin.logs.in")}),(0,d.jsx)("th",{className:"px-4 py-3 text-right",children:c("admin.logs.out")}),(0,d.jsx)("th",{className:"px-4 py-3 text-right",children:c("admin.logs.total")}),(0,d.jsx)("th",{className:"px-4 py-3 text-right",children:c("admin.logs.ms")}),(0,d.jsx)("th",{className:"px-4 py-3 text-center",children:c("admin.logs.status")})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-gray-100",children:aX.map(a=>(0,d.jsxs)("tr",{className:"bg-white hover:bg-gray-50",children:[(0,d.jsx)("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:new Date(a.createdAt).toLocaleString(fM)}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsx)("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${"anthropic"===a.provider?"bg-purple-100 text-purple-700":"bg-green-100 text-green-700"}`,children:a.provider})}),(0,d.jsx)("td",{className:"px-4 py-3 text-gray-600 font-mono text-xs",children:a.model}),(0,d.jsx)("td",{className:"px-4 py-3 text-gray-600",children:a.action}),(0,d.jsx)("td",{className:"px-4 py-3 text-gray-500",children:a.fromLocale&&a.toLocale?`${a.fromLocale} → ${a.toLocale}`:"—"}),(0,d.jsx)("td",{className:"px-4 py-3 text-right text-gray-600",children:a.inputTokens??"—"}),(0,d.jsx)("td",{className:"px-4 py-3 text-right text-gray-600",children:a.outputTokens??"—"}),(0,d.jsx)("td",{className:"px-4 py-3 text-right font-medium",children:a.totalTokens??"—"}),(0,d.jsx)("td",{className:"px-4 py-3 text-right text-gray-500",children:a.durationMs??"—"}),(0,d.jsx)("td",{className:"px-4 py-3 text-center",children:a.success?(0,d.jsx)("span",{className:"text-green-600 flex justify-center",children:(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("polyline",{points:"20 6 9 17 4 12"})})}):(0,d.jsx)("span",{className:"text-red-500 flex justify-center",title:a.error??"",children:(0,d.jsxs)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,d.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,d.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})})]},a.id))})]})}),(0,d.jsx)(D,{page:aZ,total:a_,limit:50,onChange:a$,totalLabel:c("admin.pagination.total")})]}),"activity"===bv&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:c("admin.activity.event")}),(0,d.jsxs)("select",{value:a7,onChange:a=>a8(a.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[180px]",children:[(0,d.jsx)("option",{value:"",children:c("admin.activity.all_events")}),bf.map(a=>(0,d.jsx)("option",{value:a,children:a},a))]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:c("admin.activity.from")}),(0,d.jsx)("input",{type:"date",value:bb,onChange:a=>bc(a.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:c("admin.activity.to")}),(0,d.jsx)("input",{type:"date",value:bd,onChange:a=>be(a.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(a7||bb||bd||a9)&&(0,d.jsxs)("button",{onClick:()=>{a8(""),bc(""),be(""),ba("")},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,d.jsxs)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,d.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,d.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),c("admin.activity.reset")]}),(0,d.jsxs)("p",{className:"text-xs text-gray-400 self-end ml-auto",children:[c("admin.activity.total"),": ",a3]})]}),0===a1.length?(0,d.jsx)("div",{className:"text-center py-10 text-gray-400",children:c("admin.activity.empty")}):(0,d.jsx)("div",{className:"space-y-2",children:a1.map(a=>(0,d.jsx)(G,{entry:a,dateLocale:fM,onFilterUser:a=>{ba(a),a8("")},t:c},a.id))}),(0,d.jsx)(D,{page:a5,total:a3,limit:50,onChange:a6,totalLabel:c("admin.pagination.total")})]}),"mail"===bv&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:c("admin.mail.event")}),(0,d.jsxs)("select",{value:bn,onChange:a=>bo(a.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]",children:[(0,d.jsx)("option",{value:"",children:c("admin.mail.all_events")}),bt.map(a=>(0,d.jsx)("option",{value:a,children:c(`admin.event.${a.replace(/\./g,"_")}`,a)},a))]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:c("admin.mail.from")}),(0,d.jsx)("input",{type:"date",value:bp,onChange:a=>bq(a.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:c("admin.mail.to")}),(0,d.jsx)("input",{type:"date",value:br,onChange:a=>bs(a.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(bn||bp||br)&&(0,d.jsxs)("button",{onClick:()=>{bo(""),bq(""),bs("")},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,d.jsxs)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,d.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,d.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),c("admin.mail.reset")]}),(0,d.jsxs)("p",{className:"text-xs text-gray-400 self-end ml-auto",children:[c("admin.mail.total"),": ",bj]})]}),0===bh.length?(0,d.jsx)("div",{className:"text-center py-10 text-gray-400",children:c("admin.mail.empty")}):(0,d.jsx)("div",{className:"overflow-x-auto rounded-xl border border-gray-200",children:(0,d.jsxs)("table",{className:"w-full text-sm",children:[(0,d.jsx)("thead",{className:"bg-gray-50 text-gray-500 text-xs uppercase",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-4 py-3 text-left",children:c("admin.logs.date")}),(0,d.jsx)("th",{className:"px-4 py-3 text-left",children:c("admin.mail.recipient")}),(0,d.jsx)("th",{className:"px-4 py-3 text-left",children:c("admin.mail.event")}),(0,d.jsx)("th",{className:"px-4 py-3 text-left",children:c("admin.mail.provider")}),(0,d.jsx)("th",{className:"px-4 py-3 text-left",children:c("admin.mail.details")}),(0,d.jsx)("th",{className:"px-4 py-3 text-center",children:c("admin.mail.status")})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-gray-100",children:bh.map(a=>{let b=E(a.details),e="string"==typeof b?.provider?b.provider:"—",f="string"==typeof b?.to?b.to:a.userEmail||"—",g="string"==typeof b?.subject?b.subject:"",h="string"==typeof b?.error?b.error:"",i="email.sent"===a.event||"admin.email.test.sent"===a.event;return(0,d.jsxs)("tr",{className:"bg-white hover:bg-gray-50 align-top",children:[(0,d.jsx)("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:new Date(a.createdAt).toLocaleString(fM)}),(0,d.jsx)("td",{className:"px-4 py-3 text-gray-700",children:f}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-sky-50 text-sky-700",children:c(`admin.event.${a.event.replace(/\./g,"_")}`,a.event)})}),(0,d.jsx)("td",{className:"px-4 py-3 text-gray-600",children:e}),(0,d.jsx)("td",{className:"px-4 py-3 text-gray-600 max-w-md",children:(0,d.jsx)("div",{className:"truncate",title:g||h||void 0,children:g||h||"—"})}),(0,d.jsx)("td",{className:"px-4 py-3 text-center",children:i?(0,d.jsx)("span",{className:"text-green-600 inline-flex justify-center",title:c("admin.mail.success"),children:(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("polyline",{points:"20 6 9 17 4 12"})})}):(0,d.jsx)("span",{className:"text-red-500 inline-flex justify-center",title:h||c("admin.mail.failed"),children:(0,d.jsxs)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,d.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,d.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})})]},a.id)})})]})}),(0,d.jsx)(D,{page:bl,total:bj,limit:50,onChange:bm,totalLabel:c("admin.pagination.total")})]}),"notifications"===bv&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:c("admin.notif_logs.type")}),(0,d.jsxs)("select",{value:bD,onChange:a=>bE(a.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]",children:[(0,d.jsx)("option",{value:"",children:c("admin.filter.all")}),bF.map(a=>(0,d.jsx)("option",{value:a,children:a},a))]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:c("admin.activity.from")}),(0,d.jsx)("input",{type:"date",value:bH,onChange:a=>bI(a.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:c("admin.activity.to")}),(0,d.jsx)("input",{type:"date",value:bJ,onChange:a=>bK(a.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(bD||bH||bJ)&&(0,d.jsxs)("button",{onClick:()=>{bE(""),bI(""),bK("")},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,d.jsxs)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,d.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,d.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),c("admin.activity.reset")]}),(0,d.jsxs)("p",{className:"text-xs text-gray-400 self-end ml-auto",children:[c("admin.pagination.total"),": ",bB]})]}),0===bx.length?(0,d.jsx)("div",{className:"text-center py-10 text-gray-400",children:c("admin.notif_logs.empty")}):(0,d.jsx)("div",{className:"overflow-x-auto rounded-xl border border-gray-200",children:(0,d.jsxs)("table",{className:"w-full text-sm",children:[(0,d.jsx)("thead",{className:"bg-gray-50 text-gray-500 text-xs uppercase",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-4 py-3 text-left",children:c("admin.logs.date")}),(0,d.jsx)("th",{className:"px-4 py-3 text-left",children:c("admin.col.user")}),(0,d.jsx)("th",{className:"px-4 py-3 text-left",children:c("admin.notif_logs.type")}),(0,d.jsx)("th",{className:"px-4 py-3 text-left",children:c("admin.notif_logs.title")}),(0,d.jsx)("th",{className:"px-4 py-3 text-center",children:c("admin.notif_logs.read")})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-gray-100",children:bx.map(a=>(0,d.jsxs)("tr",{className:"bg-white hover:bg-gray-50",children:[(0,d.jsx)("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:new Date(a.createdAt).toLocaleString(fM)}),(0,d.jsx)("td",{className:"px-4 py-3 text-gray-700",children:a.recipientName??a.recipientEmail??a.recipientId}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-green-50 text-green-700",children:a.type})}),(0,d.jsx)("td",{className:"px-4 py-3 text-gray-600 max-w-xs truncate",children:a.title}),(0,d.jsx)("td",{className:"px-4 py-3 text-center",children:a.isRead?(0,d.jsx)("span",{className:"text-green-600 flex justify-center",children:(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("polyline",{points:"20 6 9 17 4 12"})})}):(0,d.jsx)("span",{className:"text-gray-400 flex justify-center",children:(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"})})})})]},a.id))})]})}),(0,d.jsx)(D,{page:bz,total:bB,limit:50,onChange:bA,totalLabel:c("admin.pagination.total")})]})]}),"plans"===n&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsxs)("h2",{className:"text-lg font-semibold text-gray-800 flex items-center gap-2",children:[(0,d.jsxs)("svg",{className:"w-5 h-5 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[(0,d.jsx)("rect",{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2"}),(0,d.jsx)("line",{x1:"1",y1:"10",x2:"23",y2:"10"})]}),c("admin.plans.title")]}),(0,d.jsx)("button",{onClick:function(){cs({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:c("admin.plans.add")})]}),cr&&(0,d.jsxs)("div",{className:"bg-white border border-gray-200 rounded-xl p-5 mb-4 space-y-3",children:[(0,d.jsx)("h3",{className:"font-semibold text-gray-800",children:cr.id?c("admin.plans.form.edit"):c("admin.plans.form.new")}),(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.plans.form.name")}),(0,d.jsx)("input",{value:cr.name,onChange:a=>cs({...cr,name:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.plans.form.price")}),(0,d.jsx)("input",{type:"number",min:"0",step:"0.01",value:cr.price,onChange:a=>cs({...cr,price:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.plans.form.old_price")}),(0,d.jsx)("input",{type:"number",min:"0",step:"0.01",value:cr.oldPrice??"",onChange:a=>cs({...cr,oldPrice:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.plans.form.tier")}),(0,d.jsxs)("select",{value:cr.tier,onChange:a=>cs({...cr,tier:a.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,d.jsx)("option",{value:"free",children:c("admin.plans.form.tier.free")}),(0,d.jsx)("option",{value:"pro",children:c("admin.plans.form.tier.pro")}),(0,d.jsx)("option",{value:"ultimate",children:c("admin.plans.form.tier.ultimate")})]})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.plans.form.description")}),(0,d.jsx)("input",{value:cr.description,onChange:a=>cs({...cr,description:a.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,d.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:c("admin.plans.form.section.limits")}),(0,d.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.plans.form.max_tasks")}),(0,d.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:cr.maxTasks,onChange:a=>cs({...cr,maxTasks:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.plans.form.max_offers")}),(0,d.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:cr.maxOffers,onChange:a=>cs({...cr,maxOffers:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.plans.form.max_cards")}),(0,d.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:cr.maxCards,onChange:a=>cs({...cr,maxCards:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.plans.form.max_messages_day")}),(0,d.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:cr.maxMessagesPerDay,onChange:a=>cs({...cr,maxMessagesPerDay:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.plans.form.max_orders_day")}),(0,d.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:cr.maxOrdersPerDay,onChange:a=>cs({...cr,maxOrdersPerDay:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.plans.form.max_skills")}),(0,d.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:cr.maxSkills,onChange:a=>cs({...cr,maxSkills:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.plans.form.duration_days")}),(0,d.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:cr.durationDays,onChange:a=>cs({...cr,durationDays:a.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,d.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:c("admin.plans.form.section.boost")}),(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.plans.form.search_boost")}),(0,d.jsx)("input",{type:"number",min:"0",value:cr.searchBoost,onChange:a=>cs({...cr,searchBoost:Number(a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.plans.form.offers_multiplier")}),(0,d.jsx)("input",{type:"number",min:"0",step:"0.01",value:cr.offersMultiplier,onChange:a=>cs({...cr,offersMultiplier:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.plans.form.features")}),(0,d.jsx)("textarea",{rows:3,value:cr.features,onChange:a=>cs({...cr,features:a.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,d.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:c("admin.plans.form.section.contact")}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-2",children:[["canContactFreePlan",c("admin.plans.form.can_contact_free")],["canContactProPlan",c("admin.plans.form.can_contact_pro")],["canContactAll",c("admin.plans.form.can_contact_all")],["canShowContactInfo",c("admin.plans.form.can_show_contact")],["canViewPhone",c("admin.plans.form.can_view_phone")]].map(([a,b])=>(0,d.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,d.jsx)("input",{type:"checkbox",checked:cr[a],onChange:b=>cs({...cr,[a]:b.target.checked}),className:"w-4 h-4 rounded text-green-600"}),b]},a))}),(0,d.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:c("admin.plans.form.section.features")}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-2",children:[["notifyNewTasks",c("admin.plans.form.notify")],["canUploadVideo",c("admin.plans.form.upload_video")],["hasFavorites",c("admin.plans.form.favorites")],["hasGoogleCalendar",c("admin.plans.form.google_calendar")],["hasVerifiedBadge",c("admin.plans.form.verified_badge")],["highlightedReviews",c("admin.plans.form.highlighted_reviews")],["hasPersonalSite",c("admin.plans.form.personal_site")],["hasCanHelpNowStatus",c("admin.plans.form.can_help_now")],["hasNeedHelpStatus",c("admin.plans.form.need_help")],["hasAutoResponse",c("admin.plans.form.auto_response")],["hasAutoMatch",c("admin.plans.form.auto_match")],["hasPriceList",c("admin.plans.form.price_list")],["receiveInstantDispatchFree",c("admin.plans.form.instant_dispatch_free")],["receiveInstantDispatchPro",c("admin.plans.form.instant_dispatch_pro")]].map(([a,b])=>(0,d.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,d.jsx)("input",{type:"checkbox",checked:cr[a],onChange:b=>cs({...cr,[a]:b.target.checked}),className:"w-4 h-4 rounded text-green-600"}),b]},a))}),(0,d.jsxs)("div",{className:"flex items-center gap-6 pt-1",children:[(0,d.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,d.jsx)("input",{type:"checkbox",checked:cr.isDefault,onChange:a=>cs({...cr,isDefault:a.target.checked}),className:"w-4 h-4 rounded text-green-600"}),c("admin.plans.form.default")]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,d.jsx)("input",{type:"checkbox",checked:cr.isActive,onChange:a=>cs({...cr,isActive:a.target.checked}),className:"w-4 h-4 rounded text-green-600"}),c("admin.plans.form.active")]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("label",{className:"text-xs text-gray-600",children:c("admin.plans.form.order")}),(0,d.jsx)("input",{type:"number",value:cr.order,onChange:a=>cs({...cr,order:Number(a.target.value)}),className:"w-16 border border-gray-300 rounded-lg px-2 py-1 text-sm focus:outline-none"})]})]}),(0,d.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,d.jsx)("button",{onClick:fz,disabled:ct||!cr.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:ct?"...":c("common.save")}),(0,d.jsx)("button",{onClick:()=>cs(null),className:"px-4 py-2 rounded-lg text-sm font-medium text-gray-600 hover:bg-gray-100",children:c("common.cancel")})]})]}),(0,d.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:0===cp.length?(0,d.jsx)("div",{className:"px-4 py-8 text-center text-gray-400 text-sm",children:c("admin.plans.empty")}):(0,d.jsx)("div",{className:"divide-y divide-gray-100",children:cp.sort((a,b)=>(a.order??0)-(b.order??0)).map(a=>(0,d.jsxs)("div",{className:`flex items-start gap-4 px-4 py-4 ${!a.isActive?"opacity-50":""}`,children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"font-semibold text-gray-900",children:a.name}),a.isDefault&&(0,d.jsx)("span",{className:"bg-green-100 text-green-700 text-xs px-2 py-0.5 rounded-full font-medium",children:c("admin.plans.badge.default")}),!a.isActive&&(0,d.jsx)("span",{className:"bg-gray-100 text-gray-500 text-xs px-2 py-0.5 rounded-full",children:c("admin.plans.badge.inactive")})]}),a.description&&(0,d.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:a.description}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-3 mt-1 text-xs text-gray-500",children:[(0,d.jsxs)("span",{className:"flex items-center gap-1.5 font-semibold text-gray-800",children:[a.oldPrice&&(0,d.jsxs)("span",{className:"font-normal text-gray-400 line-through",children:[a.oldPrice," ",a.currency]}),(0,d.jsxs)("span",{children:[a.price," ",a.currency]})]}),null!=a.maxTasks&&(0,d.jsxs)("span",{children:[c("admin.plans.tasks"),": ",a.maxTasks]}),null!=a.maxOffers&&(0,d.jsxs)("span",{children:[c("admin.plans.offers"),": ",a.maxOffers]}),null!=a.maxCards&&(0,d.jsxs)("span",{children:[c("admin.plans.cards"),": ",a.maxCards]}),a.notifyNewTasks&&(0,d.jsxs)("span",{className:"text-green-700 flex items-center gap-1",children:[(0,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.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"})}),c("admin.plans.notify_tasks")]})]}),(a.features??[]).length>0&&(0,d.jsx)("ul",{className:"mt-1.5 space-y-0.5",children:a.features.map((a,b)=>(0,d.jsxs)("li",{className:"text-xs text-gray-600 flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-green-500",children:(0,d.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("polyline",{points:"20 6 9 17 4 12"})})})," ",a]},b))})]}),(0,d.jsxs)("div",{className:"flex gap-1 shrink-0",children:[!a.isDefault&&(0,d.jsx)("button",{onClick:()=>k.td(a.id,{isDefault:!0}).then(()=>k.OX().then(cq)).catch(()=>{}),className:"text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium",title:c("admin.plans.make_default"),children:(0,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.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,d.jsx)("button",{onClick:()=>{cs({id:a.id,name:a.name,description:a.description??"",role:a.role??"customer",tier:a.tier??"free",price:a.price??"0",oldPrice:a.oldPrice??"",currency:a.currency??"EUR",maxTasks:null!=a.maxTasks?String(a.maxTasks):"",maxOffers:null!=a.maxOffers?String(a.maxOffers):"",maxCards:null!=a.maxCards?String(a.maxCards):"",maxMessagesPerDay:null!=a.maxMessagesPerDay?String(a.maxMessagesPerDay):"",maxOrdersPerDay:null!=a.maxOrdersPerDay?String(a.maxOrdersPerDay):"",maxSkills:null!=a.maxSkills?String(a.maxSkills):"",durationDays:null!=a.durationDays?String(a.durationDays):"",searchBoost:a.searchBoost??0,offersMultiplier:a.offersMultiplier??"1.00",features:(a.features??[]).join("\n"),isDefault:a.isDefault??!1,isActive:a.isActive??!0,order:a.order??0,notifyNewTasks:a.notifyNewTasks??!1,canContactFreePlan:a.canContactFreePlan??!1,canContactProPlan:a.canContactProPlan??!0,canContactAll:a.canContactAll??!1,canShowContactInfo:a.canShowContactInfo??!1,canViewPhone:a.canViewPhone??!1,canUploadVideo:a.canUploadVideo??!1,hasFavorites:a.hasFavorites??!1,hasGoogleCalendar:a.hasGoogleCalendar??!1,hasVerifiedBadge:a.hasVerifiedBadge??!1,highlightedReviews:a.highlightedReviews??!1,hasPersonalSite:a.hasPersonalSite??!1,hasCanHelpNowStatus:a.hasCanHelpNowStatus??!1,hasNeedHelpStatus:a.hasNeedHelpStatus??!1,hasAutoResponse:a.hasAutoResponse??!1,hasAutoMatch:a.hasAutoMatch??!1,hasPriceList:a.hasPriceList??!1,receiveInstantDispatchFree:a.receiveInstantDispatchFree??!1,receiveInstantDispatchPro:a.receiveInstantDispatchPro??!1})},className:"text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium",children:c("common.edit")}),(0,d.jsx)("button",{onClick:()=>fA(a.id,a.name),className:"text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium",children:c("common.delete")})]})]},a.id))})})]}),"settings"===n&&(0,d.jsxs)("div",{children:[(0,d.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(a=>{let b={general:c("admin.settings.tab.general"),smtp:c("admin.settings.tab.smtp"),notifications:c("admin.settings.tab.notifications"),payment:c("admin.settings.tab.payment"),referral:c("admin.settings.tab.referral"),seo:c("admin.settings.tab.seo"),socials:c("admin.settings.tab.socials"),telegram:c("admin.settings.tab.telegram")};return(0,d.jsx)("button",{onClick:()=>c0(a),className:`px-4 py-2 rounded-lg text-sm font-medium transition ${c_===a?"bg-green-600 text-white shadow-sm":"text-gray-600 hover:bg-gray-100"}`,children:b[a]},a)})}),"general"===c_&&(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg",children:[(0,d.jsx)("h3",{className:"font-semibold text-gray-800 mb-5",children:c("admin.settings.general.title")}),(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.settings.general.site_name")}),(0,d.jsx)("input",{value:c1.siteName,onChange:a=>c2(b=>({...b,siteName:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.settings.general.site_url")}),(0,d.jsx)("input",{value:c1.siteUrl,onChange:a=>c2(b=>({...b,siteUrl:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.settings.general.contact_email")}),(0,d.jsx)("input",{type:"email",value:c1.contactEmail,onChange:a=>c2(b=>({...b,contactEmail:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.settings.general.support_phone")}),(0,d.jsx)("input",{value:c1.supportPhone,onChange:a=>c2(b=>({...b,supportPhone:a.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,d.jsxs)("label",{className:"flex cursor-pointer items-center justify-between gap-4 rounded-lg border border-gray-200 px-3 py-3",children:[(0,d.jsxs)("span",{children:[(0,d.jsx)("span",{className:"block text-sm font-medium text-gray-700",children:c("admin.settings.general.show_pricing")}),(0,d.jsx)("span",{className:"mt-0.5 block text-xs text-gray-500",children:c("admin.settings.general.show_pricing_hint")})]}),(0,d.jsx)("input",{type:"checkbox",checked:c1.showPricing,onChange:a=>c2(b=>({...b,showPricing:a.target.checked})),className:"h-5 w-5 accent-green-600"})]}),(0,d.jsx)("button",{onClick:fB,disabled:c3,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:c3?c("admin.settings.saving"):c5?c("admin.settings.saved"):c("common.save")})]})]}),"smtp"===c_&&(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg",children:[(0,d.jsx)("h3",{className:"font-semibold text-gray-800 mb-1",children:c("admin.settings.smtp.title")}),(0,d.jsx)("p",{className:"text-sm text-gray-400 mb-5",children:c("admin.settings.smtp.hint")}),(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,d.jsxs)("div",{className:"col-span-2",children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.settings.smtp.host")}),(0,d.jsx)("input",{value:c7.host,onChange:a=>c8(b=>({...b,host:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.settings.smtp.port")}),(0,d.jsx)("input",{value:c7.port,onChange:a=>c8(b=>({...b,port:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.settings.smtp.encryption")}),(0,d.jsxs)("select",{value:c7.encryption,onChange:a=>c8(b=>({...b,encryption:a.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,d.jsx)("option",{value:"none",children:c("admin.settings.smtp.enc.none")}),(0,d.jsx)("option",{value:"tls",children:"STARTTLS (587)"}),(0,d.jsx)("option",{value:"ssl",children:"SSL/TLS (465)"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.settings.smtp.username")}),(0,d.jsx)("input",{value:c7.username,onChange:a=>c8(b=>({...b,username:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.settings.smtp.password")}),(0,d.jsx)("input",{type:"password",value:c7.password,onChange:a=>c8(b=>({...b,password:a.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,d.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.settings.smtp.from_name")}),(0,d.jsx)("input",{value:c7.fromName,onChange:a=>c8(b=>({...b,fromName:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.settings.smtp.from_email")}),(0,d.jsx)("input",{type:"email",value:c7.fromEmail,onChange:a=>c8(b=>({...b,fromEmail:a.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,d.jsx)("button",{onClick:fC,disabled:c9,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:c9?c("admin.settings.saving"):db?c("admin.settings.saved"):c("common.save")}),(0,d.jsx)("button",{onClick:async()=>{de(!0),dg(null);try{let a=await k.FI();dg(`✓ Sent to ${a.to}`)}catch(a){dg(`✗ Error: ${a.message}`)}finally{de(!1),setTimeout(()=>dg(null),5e3)}},disabled:dd,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:dd?c("admin.settings.smtp.sending"):(0,d.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.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"})}),c("admin.settings.smtp.test")]})}),df&&(0,d.jsx)("p",{className:`text-sm text-center font-medium ${df.startsWith("✓")?"text-green-600":"text-red-500"}`,children:df})]})]}),"payment"===c_&&(0,d.jsxs)("div",{className:"space-y-6 max-w-lg",children:[(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.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,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"font-semibold text-gray-800",children:"ePay — Piraeus Bank"}),(0,d.jsx)("p",{className:"text-xs text-gray-400",children:"Греческий платёжный шлюз"})]})]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,d.jsx)("span",{className:"text-sm text-gray-500",children:c("admin.settings.active")}),(0,d.jsx)("button",{type:"button",onClick:()=>dt(a=>({...a,enabled:!a.enabled})),className:`relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ${ds.enabled?"bg-green-600":"bg-gray-300"}`,children:(0,d.jsx)("span",{className:`absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${ds.enabled?"translate-x-5":"translate-x-1"}`})})]})]}),(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.settings.env.label")}),(0,d.jsxs)("select",{value:ds.environment,onChange:a=>dt(b=>({...b,environment:a.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,d.jsx)("option",{value:"test",children:c("admin.settings.env.test")}),(0,d.jsx)("option",{value:"production",children:c("admin.settings.env.prod")})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.settings.merchant_id")}),(0,d.jsx)("input",{value:ds.merchantId,onChange:a=>dt(b=>({...b,merchantId:a.target.value})),placeholder:c("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,d.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"API User"}),(0,d.jsx)("input",{value:ds.apiUser,onChange:a=>dt(b=>({...b,apiUser:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"API Password"}),(0,d.jsx)("input",{type:"password",value:ds.apiPassword,onChange:a=>dt(b=>({...b,apiPassword:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Confirmation URL (webhook)"}),(0,d.jsx)("input",{value:ds.confirmationUrl,onChange:a=>dt(b=>({...b,confirmationUrl:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Cancel URL"}),(0,d.jsx)("input",{value:ds.cancelUrl,onChange:a=>dt(b=>({...b,cancelUrl:a.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,d.jsxs)("div",{className:"flex items-center gap-3 mt-5",children:[(0,d.jsx)("button",{onClick:fF,disabled:du,className:"px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:du?c("admin.settings.saving"):c("common.save")}),dw&&(0,d.jsx)("span",{className:"text-sm text-green-600",children:c("admin.settings.saved")})]})]}),(0,d.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,d.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,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,d.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),(0,d.jsx)("span",{children:c("admin.settings.payment.hint")})]})]}),"notifications"===c_&&(0,d.jsxs)("div",{className:"space-y-3 max-w-2xl",children:[(0,d.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,d.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,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,d.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),(0,d.jsxs)("p",{children:[c("admin.notif.vars_hint")," ",p.map(a=>{let b=`{{${a}}}`;return(0,d.jsx)("code",{className:"mx-0.5 bg-green-100 text-gray-800 px-1.5 py-0.5 rounded text-xs font-mono",children:b},b)})]})]}),[{key:"email_verification",label:c("admin.notif.email_verification"),icon:(0,d.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,d.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:c("admin.notif.registration_success"),icon:(0,d.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,d.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:c("admin.notif.password_reset"),icon:(0,d.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,d.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:c("admin.notif.new_offer"),icon:(0,d.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,d.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:c("admin.notif.new_task"),icon:(0,d.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,d.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:c("admin.notif.offer_accepted"),icon:(0,d.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,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})},{key:"new_message",label:c("admin.notif.new_message"),icon:(0,d.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,d.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:c("admin.notif.offer_declined"),icon:(0,d.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,d.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:c("admin.notif.offer_other_accepted"),icon:(0,d.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,d.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:c("admin.notif.task_updated"),icon:(0,d.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,d.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:c("admin.notif.deadline_reminder"),icon:(0,d.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,d.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:c("admin.notif.task_archived"),icon:(0,d.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,d.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:c("admin.notif.referral_reward"),icon:(0,d.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,d.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:c("admin.email_template.plan_activated"),icon:(0,d.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,d.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:c("admin.email_template.plan_upgraded"),icon:(0,d.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,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 10l7-7m0 0l7 7m-7-7v18"})})},{key:"plan_downgrade_scheduled",label:c("admin.email_template.plan_downgrade_scheduled"),icon:(0,d.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,d.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:c("admin.email_template.plan_downgrade_applied"),icon:(0,d.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,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})},{key:"plan_renewal_reminder",label:c("admin.email_template.plan_renewal_reminder"),icon:(0,d.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,d.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:c("admin.email_template.plan_insufficient_funds"),icon:(0,d.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,d.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(({key:a,label:b,icon:e})=>{let f=`${a}_${dl}`,g=dh[f]??dh[a]??{subject:"",body:""},h=dj===a,i=o[a]??[];return(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 px-5 py-4 cursor-pointer hover:bg-gray-50 select-none",onClick:()=>dk(h?null:a),children:[(0,d.jsx)("span",{className:"text-xl shrink-0",children:e}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"font-medium text-gray-800 text-sm",children:b}),g.subject?(0,d.jsxs)("div",{className:"text-xs text-gray-400 mt-0.5 truncate",children:[c("admin.notif.tmpl.subject_label"),": ",g.subject]}):(0,d.jsx)("div",{className:"text-xs text-gray-300 mt-0.5 italic",children:c("admin.notif.tmpl.not_set")})]}),(0,d.jsx)("span",{className:`text-gray-400 transition-transform ${h?"rotate-90":""}`,children:(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("polyline",{points:"9 18 15 12 9 6"})})})]}),h&&(0,d.jsxs)("div",{className:"px-5 pb-5 border-t border-gray-100 pt-4 space-y-3",children:[(0,d.jsx)("div",{className:"flex gap-1 pb-2",children:["el","en","uk","ru"].map(a=>(0,d.jsx)("button",{type:"button",onClick:()=>dm(a),className:`px-3 py-1 text-xs font-medium rounded-md transition-colors ${dl===a?"bg-green-600 text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:"el"===a?"Ελληνικά":"en"===a?"English":"uk"===a?"Українська":"Русский"},a))}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.notif.tmpl.subject_label")}),(0,d.jsx)("input",{value:g.subject,onChange:a=>di(b=>({...b,[f]:{...b[f]??{subject:"",body:""},subject:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:c("admin.notif.tmpl.body_label")}),(0,d.jsx)("textarea",{rows:7,value:g.body,onChange:a=>di(b=>({...b,[f]:{...b[f]??{subject:"",body:""},body:a.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:"<p>Уважаемый {{userName}},</p>..."})]}),i.length>0&&(0,d.jsxs)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2",children:[(0,d.jsx)("div",{className:"text-xs font-medium text-amber-800 mb-1",children:c("admin.notif.vars_hint")}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:i.map(a=>{let b=`{{${a}}}`;return(0,d.jsx)("code",{className:"bg-amber-100 text-amber-900 px-1.5 py-0.5 rounded text-xs font-mono",children:b},b)})})]}),(0,d.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,d.jsx)("button",{onClick:()=>fE(a),disabled:dn||dq,className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:dn?c("admin.notif.tmpl.saving"):c("admin.notif.tmpl.save")}),(0,d.jsxs)("button",{onClick:()=>fD(a),disabled:dn||dq,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,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.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"})}),dq?c("admin.notif.tmpl.translating"):c("admin.notif.tmpl.translate")]}),(0,d.jsx)("button",{onClick:()=>dk(null),className:"px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200",children:c("admin.notif.tmpl.close")})]})]})]},a)})]}),"referral"===c_&&(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"font-semibold text-gray-800",children:c("admin.settings.referral.title")}),(0,d.jsx)("p",{className:"text-sm text-gray-400 mt-1",children:c("admin.settings.referral.hint")})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium text-gray-700",children:c("admin.settings.referral.enabled_label")}),(0,d.jsx)("p",{className:"text-xs text-gray-400",children:c("admin.settings.referral.enabled_hint")})]}),(0,d.jsx)("button",{type:"button",onClick:()=>dz(a=>({...a,enabled:!a.enabled})),className:`relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ${dy.enabled?"bg-green-600":"bg-gray-300"}`,children:(0,d.jsx)("span",{className:`absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${dy.enabled?"translate-x-5":"translate-x-1"}`})})]}),(0,d.jsxs)("div",{className:"border border-gray-100 rounded-lg p-4 space-y-4",children:[(0,d.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:c("admin.settings.referral.shared_section")}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.settings.referral.plan_label")}),(0,d.jsxs)("select",{value:dy.planId,onChange:a=>dz(b=>({...b,planId:a.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,d.jsx)("option",{value:"",children:c("admin.settings.referral.no_plan")}),cp.map(a=>(0,d.jsx)("option",{value:a.id,children:a.name},a.id))]}),(0,d.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:c("admin.settings.referral.plan_hint")})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.settings.referral.days_label")}),(0,d.jsx)("input",{type:"number",min:"1",max:"365",value:dy.days,onChange:a=>dz(b=>({...b,days:a.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,d.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:c("admin.settings.referral.days_hint")})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("button",{onClick:fG,disabled:dA,className:"px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:dA?c("admin.settings.saving"):c("common.save")}),dC&&(0,d.jsx)("span",{className:"text-sm text-green-600",children:c("admin.settings.saved")})]})]}),"socials"===c_&&(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"font-semibold text-gray-800 mb-1",children:c("admin.settings.socials.title")}),(0,d.jsx)("p",{className:"text-xs text-gray-400",children:c("admin.settings.socials.hint")})]}),[{key:"telegram",label:"Telegram",placeholder:"https://t.me/yourname",icon:(0,d.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,d.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,d.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,d.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,d.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,d.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,d.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,d.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,d.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,d.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,d.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,d.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,d.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,d.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,d.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,d.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(({key:a,label:b,placeholder:c,icon:e})=>(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1 flex items-center gap-2",children:[(0,d.jsx)("span",{className:`${dM[a]?"text-green-600":"text-gray-300"}`,children:e}),b,!dM[a]&&(0,d.jsx)("span",{className:"text-xs font-normal text-gray-400 ml-auto",children:"не заполнено"})]}),(0,d.jsx)("input",{type:"url",value:dM[a],onChange:b=>dN(c=>({...c,[a]:b.target.value})),placeholder:c,className:`w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ${dM[a]?"border-green-300 bg-green-50/30":"border-gray-300"}`})]},a)),(0,d.jsxs)("div",{className:"flex items-center gap-3 pt-2",children:[(0,d.jsx)("button",{onClick:fI,disabled:dO,className:"px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:dO?c("admin.settings.saving"):c("common.save")}),dQ&&(0,d.jsx)("span",{className:"text-sm text-green-600",children:c("admin.settings.saved")})]})]}),"seo"===c_&&(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6",children:[(0,d.jsx)("h3",{className:"font-semibold text-gray-800",children:c("admin.settings.seo.title")}),(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium text-gray-700",children:c("admin.settings.seo.maintenance_label")}),(0,d.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:c("admin.settings.seo.maintenance_hint")})]}),(0,d.jsx)("button",{type:"button",onClick:()=>dF(a=>({...a,maintenanceMode:!a.maintenanceMode})),className:`relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ${dE.maintenanceMode?"bg-red-500":"bg-gray-300"}`,children:(0,d.jsx)("span",{className:`absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${dE.maintenanceMode?"translate-x-5":"translate-x-1"}`})})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium text-gray-700",children:c("admin.settings.seo.indexing_label")}),(0,d.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:c("admin.settings.seo.indexing_hint")})]}),(0,d.jsx)("button",{type:"button",onClick:()=>dF(a=>({...a,indexingEnabled:!a.indexingEnabled})),className:`relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ${dE.indexingEnabled?"bg-green-600":"bg-gray-300"}`,children:(0,d.jsx)("span",{className:`absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${dE.indexingEnabled?"translate-x-5":"translate-x-1"}`})})]}),(0,d.jsx)("div",{className:"space-y-4",children:(0,d.jsxs)("div",{children:[(0,d.jsxs)("p",{className:"text-sm font-medium text-gray-700 mb-2",children:[c("admin.settings.seo.site_title_label")," / ",c("admin.settings.seo.site_description_label")]}),(0,d.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(({code:a,flag:b,label:c})=>(0,d.jsxs)("button",{type:"button",onClick:()=>dL(a),className:`flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${dK===a?"bg-green-600 text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:[b," ",c]},a))}),(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:c("admin.settings.seo.site_title_label")}),(0,d.jsx)("input",{value:dE[`siteTitle${dK.charAt(0).toUpperCase()+dK.slice(1)}`],onChange:a=>dF(b=>({...b,[`siteTitle${dK.charAt(0).toUpperCase()+dK.slice(1)}`]:a.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"===dK?"CanHelp — Κάθε άνθρωπος έχει κάτι να προσφέρει":"en"===dK?"CanHelp — Everyone has something valuable to offer":"ru"===dK?"CanHelp — Каждый человек может чем-то помочь":"CanHelp — Кожен має навичку, яка може допомогти іншому"}),(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:c("admin.settings.seo.site_description_label")}),(0,d.jsx)("textarea",{rows:3,value:dE[`siteDescription${dK.charAt(0).toUpperCase()+dK.slice(1)}`],onChange:a=>dF(b=>({...b,[`siteDescription${dK.charAt(0).toUpperCase()+dK.slice(1)}`]:a.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"===dK?"Η ελληνική πλατφόρμα για online ανάθεση εργασιών...":"en"===dK?"The Greek platform for online task delegation...":"ru"===dK?"Греческая платформа для онлайн-поиска специалистов...":"Грецька платформа для пошуку фахівців онлайн..."})]})}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.settings.seo.head_scripts_label")}),(0,d.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:c("admin.settings.seo.head_scripts_hint")}),(0,d.jsx)("textarea",{rows:6,value:dE.headScripts,onChange:a=>dF(b=>({...b,headScripts:a.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<script>...<\/script>",spellCheck:!1})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("button",{onClick:fH,disabled:dG,className:"px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:dG?c("admin.settings.saving"):c("common.save")}),dI&&(0,d.jsx)("span",{className:"text-sm text-green-600",children:c("admin.settings.saved")})]})]}),"telegram"===c_&&(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"font-semibold text-gray-800 mb-1",children:c("admin.settings.telegram.title")}),(0,d.jsx)("p",{className:"text-xs text-gray-400",children:c("admin.settings.telegram.help")})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.settings.telegram.bot_token")}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("input",{type:"text",value:dS.botToken,onChange:a=>{dT(b=>({...b,botToken:a.target.value})),eb(null)},placeholder:"1234567890:ABCDefgh...",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 font-mono"}),(0,d.jsx)("button",{onClick:fL,disabled:d8||!dS.botToken,className:"px-3 py-2 border border-gray-300 rounded-lg text-sm hover:bg-gray-50 disabled:opacity-40 flex-shrink-0",children:d8?"...":c("admin.settings.telegram.verify")})]}),ea&&(0,d.jsx)("p",{className:`text-xs mt-1 font-medium ${ea.ok?"text-green-600":"text-red-500"}`,children:ea.ok?`✓ ${ea.msg}`:`✗ ${ea.msg}`})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.settings.telegram.admin_chat_id")}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("input",{type:"text",value:dS.adminChatId,onChange:a=>dT(b=>({...b,adminChatId:a.target.value})),placeholder:"-100123456789",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 font-mono"}),(0,d.jsx)("button",{onClick:()=>fK("admin"),disabled:dY||!dS.botToken||!dS.adminChatId,className:"px-3 py-2 border border-gray-300 rounded-lg text-sm hover:bg-gray-50 disabled:opacity-40 flex-shrink-0",children:dY?"...":c("admin.settings.telegram.test")})]}),(0,d.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:c("admin.settings.telegram.admin_chat_hint")}),d0&&(0,d.jsx)("p",{className:`text-xs mt-1 font-medium ${d0.ok?"text-green-600":"text-red-500"}`,children:d0.ok?`✓ ${d0.msg}`:`✗ ${d0.msg}`})]}),(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:c("admin.settings.telegram.channels_title")}),(0,d.jsx)("p",{className:"text-xs text-gray-400 -mt-2",children:c("admin.settings.telegram.channel_hint")}),[{locale:"el",flag:"\uD83C\uDDEC\uD83C\uDDF7",label:"Ελληνικά",field:"channelIdEl"},{locale:"en",flag:"\uD83C\uDDEC\uD83C\uDDE7",label:"English",field:"channelIdEn"},{locale:"ru",flag:"\uD83C\uDDF7\uD83C\uDDFA",label:"Русский",field:"channelIdRu"},{locale:"uk",flag:"\uD83C\uDDFA\uD83C\uDDE6",label:"Українська",field:"channelIdUk"}].map(({locale:a,flag:b,label:e,field:f})=>(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,d.jsx)("span",{className:"text-base leading-none",children:b}),(0,d.jsx)("span",{className:"text-xs font-medium text-gray-600",children:e})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("input",{type:"text",value:dS[f],onChange:a=>dT(b=>({...b,[f]:a.target.value})),placeholder:"@channel или -100...",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 font-mono"}),(0,d.jsx)("button",{onClick:()=>fK(a),disabled:d4===a||!dS.botToken||!dS[f],className:"px-3 py-2 border border-gray-300 rounded-lg text-sm hover:bg-gray-50 disabled:opacity-40 flex-shrink-0",children:d4===a?"...":c("admin.settings.telegram.test")})]}),d6[a]&&(0,d.jsx)("p",{className:`text-xs mt-1 font-medium ${d6[a].ok?"text-green-600":"text-red-500"}`,children:d6[a].ok?`✓ ${d6[a].msg}`:`✗ ${d6[a].msg}`})]},a))]}),(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium text-gray-700",children:c("admin.settings.telegram.notify_registrations")}),(0,d.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:c("admin.settings.telegram.notify_registrations_hint")})]}),(0,d.jsx)("button",{type:"button",onClick:()=>dT(a=>({...a,notifyRegistrations:!a.notifyRegistrations})),className:`relative w-10 h-6 rounded-full transition-colors cursor-pointer flex-shrink-0 p-0 border-0 outline-none ${dS.notifyRegistrations?"bg-green-600":"bg-gray-300"}`,children:(0,d.jsx)("span",{className:`absolute top-1 left-0 w-4 h-4 bg-white rounded-full shadow transition-transform ${dS.notifyRegistrations?"translate-x-5":"translate-x-1"}`})})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium text-gray-700",children:c("admin.settings.telegram.post_new_tasks")}),(0,d.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:c("admin.settings.telegram.post_new_tasks_hint")})]}),(0,d.jsx)("button",{type:"button",onClick:()=>dT(a=>({...a,postNewTasks:!a.postNewTasks})),className:`relative w-10 h-6 rounded-full transition-colors cursor-pointer flex-shrink-0 p-0 border-0 outline-none ${dS.postNewTasks?"bg-green-600":"bg-gray-300"}`,children:(0,d.jsx)("span",{className:`absolute top-1 left-0 w-4 h-4 bg-white rounded-full shadow transition-transform ${dS.postNewTasks?"translate-x-5":"translate-x-1"}`})})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3 pt-2",children:[(0,d.jsx)("button",{onClick:fJ,disabled:dU,className:"px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:dU?c("admin.settings.saving"):c("common.save")}),dW&&(0,d.jsx)("span",{className:"text-sm text-green-600",children:c("admin.settings.saved")})]})]})]}),"support"===n&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex flex-wrap gap-3 mb-2",children:[(0,d.jsxs)("form",{className:"flex gap-2",onSubmit:a=>{a.preventDefault(),aO(aP),aG(1)},children:[(0,d.jsx)("input",{value:aP,onChange:a=>aQ(a.target.value),placeholder:c("admin.support.search","Search..."),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 w-52"}),(0,d.jsx)("button",{type:"submit",className:"bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700",children:c("admin.search","Search")}),aN&&(0,d.jsx)("button",{type:"button",onClick:()=>{aQ(""),aO(""),aG(1)},className:"text-sm text-gray-500 hover:text-gray-700 px-2",children:"✕"})]}),(0,d.jsxs)("select",{value:aJ,onChange:a=>{aK(a.target.value),aG(1)},className:"border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",children:[(0,d.jsx)("option",{value:"",children:c("admin.support.all_statuses","All statuses")}),(0,d.jsx)("option",{value:"open",children:c("admin.support.status.open","Open")}),(0,d.jsx)("option",{value:"in_progress",children:c("admin.support.status.in_progress","In progress")}),(0,d.jsx)("option",{value:"resolved",children:c("admin.support.status.resolved","Resolved")}),(0,d.jsx)("option",{value:"closed",children:c("admin.support.status.closed","Closed")})]}),(0,d.jsxs)("select",{value:aL,onChange:a=>{aM(a.target.value),aG(1)},className:"border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",children:[(0,d.jsx)("option",{value:"",children:c("admin.support.all_types","All types")}),(0,d.jsxs)("option",{value:"bug",children:["\uD83D\uDC1B ",c("support.type.bug","Bug")]}),(0,d.jsxs)("option",{value:"suggestion",children:["\uD83D\uDCA1 ",c("support.type.suggestion","Suggestion")]}),(0,d.jsxs)("option",{value:"other",children:["\uD83D\uDCAC ",c("support.type.other","Other")]})]}),(0,d.jsxs)("span",{className:"ml-auto text-sm text-gray-400 self-center",children:[aH," ",c("admin.pagination.total","total")]})]}),fa?(0,d.jsx)("div",{className:"text-center py-10 text-gray-400",children:c("common.loading")}):0===aD.length?(0,d.jsx)("div",{className:"text-center py-10 text-gray-400",children:c("admin.support.none","No tickets")}):aD.map(a=>{let b=aR===a.id;return(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-3",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[(0,d.jsxs)("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${{bug:"bg-red-100 text-red-700",suggestion:"bg-green-100 text-green-700",other:"bg-gray-100 text-gray-600"}[a.type]??"bg-gray-100 text-gray-600"}`,children:[{bug:"\uD83D\uDC1B",suggestion:"\uD83D\uDCA1",other:"\uD83D\uDCAC"}[a.type]," ",a.type]}),(0,d.jsx)("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${{open:"bg-green-100 text-green-700",in_progress:"bg-green-100 text-green-700",resolved:"bg-gray-100 text-gray-500",closed:"bg-gray-200 text-gray-400"}[a.status]??"bg-gray-100 text-gray-500"}`,children:a.status}),(0,d.jsxs)("span",{className:"text-xs text-gray-400",children:["#",a.id.slice(0,8)]})]}),(0,d.jsx)("h3",{className:"font-semibold text-gray-900 text-sm",children:a.subject}),a.userName&&(0,d.jsxs)("p",{className:"text-xs text-gray-400 mt-0.5",children:[a.userName," \xb7 ",a.userEmail]}),(0,d.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:new Date(a.createdAt).toLocaleString(fM)})]}),(0,d.jsxs)("div",{className:"flex gap-2 flex-shrink-0",children:["closed"!==a.status&&(0,d.jsx)("button",{onClick:()=>{aS(b?null:a.id),aU(a.adminReply||"")},className:"text-xs px-3 py-1.5 rounded-lg font-medium bg-green-50 text-green-700 hover:bg-green-100",children:b?c("admin.support.cancel","Cancel"):c("admin.support.reply","Reply")}),"open"===a.status&&(0,d.jsx)("button",{onClick:()=>k.u0(a.id,"closed").then(()=>aE(b=>b.map(b=>b.id===a.id?{...b,status:"closed"}:b))),className:"text-xs px-3 py-1.5 rounded-lg font-medium bg-gray-100 text-gray-600 hover:bg-gray-200",children:c("admin.support.close","Close")})]})]}),(0,d.jsx)("p",{className:"text-sm text-gray-700 whitespace-pre-wrap bg-gray-50 rounded-lg p-3 mb-3",children:a.body}),a.adminReply&&!b&&(0,d.jsxs)("div",{className:"bg-green-50 border border-green-100 rounded-lg p-3 mb-2",children:[(0,d.jsxs)("p",{className:"text-xs font-medium text-green-600 mb-1",children:[c("admin.support.your_reply","Your reply"),":"]}),(0,d.jsx)("p",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:a.adminReply})]}),b&&(0,d.jsxs)("div",{className:"space-y-2 mt-2",children:[(0,d.jsx)("textarea",{rows:3,value:aT,onChange:a=>aU(a.target.value),placeholder:c("admin.support.reply_placeholder","Write a reply..."),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,d.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,d.jsxs)("select",{id:`status-${a.id}`,defaultValue:"resolved",className:"border border-gray-300 rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",children:[(0,d.jsx)("option",{value:"open",children:c("admin.support.status.open","Open")}),(0,d.jsx)("option",{value:"in_progress",children:c("admin.support.status.in_progress","In progress")}),(0,d.jsx)("option",{value:"resolved",children:c("admin.support.status.resolved","Resolved")}),(0,d.jsx)("option",{value:"closed",children:c("admin.support.status.closed","Closed")})]}),(0,d.jsx)("button",{disabled:aV||!aT.trim(),onClick:async()=>{let b=document.getElementById(`status-${a.id}`);aW(!0);try{let c=await k.nT(a.id,{adminReply:aT,status:b?.value});aE(b=>b.map(b=>b.id===a.id?{...b,...c}:b)),aS(null)}catch{}finally{aW(!1)}},className:"bg-green-600 text-white px-4 py-1.5 rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:aV?"...":c("admin.support.send_reply","Send")})]})]})]},a.id)}),(0,d.jsx)(D,{page:aF,total:aH,limit:30,onChange:aG,totalLabel:c("admin.pagination.total")})]}),"push"===n&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5 space-y-4",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-gray-800",children:"Push-рассылка"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:()=>eT("broadcast"),className:`px-3 py-1.5 text-sm rounded-lg border ${"broadcast"===eS?"bg-green-600 text-white border-green-600":"bg-white text-gray-700 border-gray-300"}`,children:"Всем пользователям"}),(0,d.jsx)("button",{type:"button",onClick:()=>eT("user"),className:`px-3 py-1.5 text-sm rounded-lg border ${"user"===eS?"bg-green-600 text-white border-green-600":"bg-white text-gray-700 border-gray-300"}`,children:"Конкретному пользователю"})]}),"user"===eS&&(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm text-gray-600 block mb-1",children:"User ID"}),(0,d.jsx)("input",{value:eU,onChange:a=>eV(a.target.value),placeholder:"UUID пользователя",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"})]}),"broadcast"===eS&&(0,d.jsxs)("label",{className:"flex items-center gap-2 text-sm text-gray-700",children:[(0,d.jsx)("input",{type:"checkbox",checked:e2,onChange:a=>e3(a.target.checked)}),"Только активным пользователям"]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm text-gray-600 block mb-1",children:"Заголовок"}),(0,d.jsx)("input",{value:eW,onChange:a=>eX(a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm text-gray-600 block mb-1",children:"Текст"}),(0,d.jsx)("textarea",{rows:3,value:eY,onChange:a=>eZ(a.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 resize-none"})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm text-gray-600 block mb-1",children:"Тип"}),(0,d.jsx)("input",{value:e$,onChange:a=>e_(a.target.value),placeholder:"task_update / chat_message / referral_reward",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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm text-gray-600 block mb-1",children:"Reference ID (опционально)"}),(0,d.jsx)("input",{value:e0,onChange:a=>e1(a.target.value),placeholder:"taskId, chatId и т.д.",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,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("button",{type:"button",onClick:fc,disabled:e4||!eW.trim()||"user"===eS&&!eU.trim(),className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:e4?"Отправка...":"Отправить Push"}),e8&&(0,d.jsx)("span",{className:"text-sm text-red-600",children:e8})]})]}),e6&&(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,d.jsx)("h3",{className:"font-semibold text-gray-800 mb-3",children:"Результат"}),"usersTotal"in e6?(0,d.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3 text-sm",children:[(0,d.jsxs)("div",{className:"rounded-lg bg-gray-50 border border-gray-200 px-3 py-2",children:[(0,d.jsx)("div",{className:"text-gray-500",children:"Пользователей"}),(0,d.jsx)("div",{className:"text-gray-900 font-semibold",children:e6.usersTotal})]}),(0,d.jsxs)("div",{className:"rounded-lg bg-gray-50 border border-gray-200 px-3 py-2",children:[(0,d.jsx)("div",{className:"text-gray-500",children:"Получили"}),(0,d.jsx)("div",{className:"text-gray-900 font-semibold",children:e6.usersWithSent})]}),(0,d.jsxs)("div",{className:"rounded-lg bg-gray-50 border border-gray-200 px-3 py-2",children:[(0,d.jsx)("div",{className:"text-gray-500",children:"Отправлено push"}),(0,d.jsx)("div",{className:"text-gray-900 font-semibold",children:e6.pushesSent})]}),(0,d.jsxs)("div",{className:"rounded-lg bg-gray-50 border border-gray-200 px-3 py-2",children:[(0,d.jsx)("div",{className:"text-gray-500",children:"Невалидные токены"}),(0,d.jsx)("div",{className:"text-gray-900 font-semibold",children:e6.invalidTokens})]}),(0,d.jsxs)("div",{className:"rounded-lg bg-gray-50 border border-gray-200 px-3 py-2",children:[(0,d.jsx)("div",{className:"text-gray-500",children:"Ошибки по userId"}),(0,d.jsx)("div",{className:"text-gray-900 font-semibold",children:e6.failedUsers.length})]})]}):(0,d.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 text-sm",children:[(0,d.jsxs)("div",{className:"rounded-lg bg-gray-50 border border-gray-200 px-3 py-2",children:[(0,d.jsx)("div",{className:"text-gray-500",children:"User ID"}),(0,d.jsx)("div",{className:"text-gray-900 font-mono text-xs break-all",children:e6.targetUserId})]}),(0,d.jsxs)("div",{className:"rounded-lg bg-gray-50 border border-gray-200 px-3 py-2",children:[(0,d.jsx)("div",{className:"text-gray-500",children:"Токенов найдено"}),(0,d.jsx)("div",{className:"text-gray-900 font-semibold",children:e6.tokensFound??0})]}),(0,d.jsxs)("div",{className:"rounded-lg bg-gray-50 border border-gray-200 px-3 py-2",children:[(0,d.jsx)("div",{className:"text-gray-500",children:"Отправлено push"}),(0,d.jsx)("div",{className:"text-gray-900 font-semibold",children:e6.sent})]}),(0,d.jsxs)("div",{className:"rounded-lg bg-gray-50 border border-gray-200 px-3 py-2",children:[(0,d.jsx)("div",{className:"text-gray-500",children:"Невалидные токены"}),(0,d.jsx)("div",{className:"text-gray-900 font-semibold",children:e6.invalidTokens})]})]}),"usersTotal"in e6?(0,d.jsx)(d.Fragment,{children:(e6.usersWithoutTokens??0)>0||(e6.usersConfigBlocked??0)>0||(e6.usersAuthFailed??0)>0||(e6.usersAllFailed??0)>0?(0,d.jsxs)("div",{className:"mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900",children:[(0,d.jsxs)("div",{children:["Диагностика: без токенов — ",e6.usersWithoutTokens??0,", FCM не настроен — ",e6.usersConfigBlocked??0,", ошибка auth FCM — ",e6.usersAuthFailed??0,", FCM send failed — ",e6.usersAllFailed??0]}),e6.failedReasonStats&&Object.keys(e6.failedReasonStats).length>0?(0,d.jsxs)("div",{className:"mt-1",children:["Коды ошибок FCM: ",Object.entries(e6.failedReasonStats).map(([a,b])=>`${a}: ${b}`).join(", ")]}):null,e6.failedReasonSample?(0,d.jsxs)("div",{className:"mt-1",children:["Пример ошибки: ",fe(e6.failedReasonStats?Object.keys(e6.failedReasonStats)[0]:null,e6.failedReasonSample)]}):null]}):null}):(0,d.jsx)(d.Fragment,{children:e6.reason?(0,d.jsxs)("div",{className:"mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900",children:[(0,d.jsxs)("div",{children:["Диагностика: ","no_tokens"===e6.reason?"у пользователя нет push-токенов":"fcm_not_configured"===e6.reason?"FCM не настроен на API (переменные FCM_*)":"fcm_auth_failed"===e6.reason?"ошибка авторизации FCM (service account)":fe(e6.failureKey,e6.failureMessage)]}),e6.failureKey?(0,d.jsxs)("div",{className:"mt-1",children:["Код FCM: ",e6.failureKey]}):null,e6.failureMessage?(0,d.jsxs)("div",{className:"mt-1",children:["Сообщение FCM: ",e6.failureMessage]}):null]}):null})]})]}),"backup"===n&&(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsxs)("h2",{className:"text-lg font-semibold text-gray-800 flex items-center gap-2",children:[(0,d.jsx)("svg",{className:"w-5 h-5 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,d.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"})}),c("admin.backup.title","Backup")]}),es&&(0,d.jsxs)("div",{className:`${eu?"bg-red-50 border-red-200 text-red-700":"bg-green-50 border-green-200 text-green-700"} border rounded-lg px-4 py-2 text-sm flex items-center justify-between`,children:[(0,d.jsx)("span",{children:es}),(0,d.jsx)("button",{onClick:()=>et(null),className:`${eu?"text-red-500 hover:text-red-700":"text-green-500 hover:text-green-700"} ml-4`,children:"\xd7"})]}),(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5 flex items-center justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"font-medium text-gray-800 text-sm",children:c("admin.backup.autoBackup","Auto Backup")}),(0,d.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:c("admin.backup.autoBackupDesc","Create a backup every day automatically")})]}),(0,d.jsx)("button",{disabled:ee,onClick:async()=>{ef(!0);try{await (0,k.Em)("/admin/backup/settings",{method:"PUT",body:JSON.stringify({autoEnabled:!ec})}),ed(a=>!a)}catch{}ef(!1)},className:`relative w-11 h-6 rounded-full transition-colors ${ec?"bg-green-600":"bg-gray-300"} ${ee?"opacity-50":""}`,children:(0,d.jsx)("span",{className:`absolute top-0.5 left-0.5 w-5 h-5 rounded-full bg-white shadow transition-transform ${ec?"translate-x-5":"translate-x-0"}`})})]}),(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,d.jsx)("h3",{className:"font-semibold text-gray-800 text-sm mb-4",children:c("admin.backup.title","Database Backup")}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-3",children:[(0,d.jsxs)("button",{disabled:em,onClick:async()=>{en(!0);try{let a=await fetch("https://api.canhelp.gr/api/admin/backup/export",{credentials:"include"});if(!a.ok)throw Error("Export failed");let b=await a.blob(),d=URL.createObjectURL(b),e=document.createElement("a");e.href=d,e.download=`backup_${new Date().toISOString().slice(0,10)}.sql.gz`,e.click(),URL.revokeObjectURL(d),ew(c("admin.backup.exportSuccess","Export successful"))}catch(a){ex(a.message||"Error")}en(!1)},className:"bg-green-600 hover:bg-green-700 text-white text-sm px-4 py-2 rounded-lg font-medium disabled:opacity-50 flex items-center gap-2",children:[(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),em?c("admin.backup.exporting","Exporting..."):c("admin.backup.exportAll","Export Full DB")]}),(0,d.jsxs)("label",{className:`bg-gray-100 hover:bg-gray-200 text-gray-700 text-sm px-4 py-2 rounded-lg font-medium cursor-pointer flex items-center gap-2 ${"full"===eo?"opacity-50 pointer-events-none":""}`,children:[(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l4-4m0 0l4 4m-4-4v12"})}),"full"===eo?c("admin.backup.importing","Importing..."):c("admin.backup.importAll","Import Full DB"),(0,d.jsx)("input",{type:"file",accept:".sql.gz,.gz",className:"hidden",onChange:async a=>{let b=a.target.files?.[0];if(b&&window.confirm(c("admin.backup.restoreConfirm","Restore from this backup?"))){ep("full");try{let a=new FormData;if(a.append("file",b),!(await fetch("https://api.canhelp.gr/api/admin/backup/import",{method:"POST",credentials:"include",body:a})).ok)throw Error("Import failed");ew(c("admin.backup.importSuccess","Import successful"))}catch(a){ex(a.message||"Error")}ep(null),a.target.value=""}}})]})]})]}),(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,d.jsx)("h3",{className:"font-semibold text-gray-800 text-sm mb-4",children:c("admin.backup.storedBackups","Stored Backups")}),0===ek.length?(0,d.jsx)("p",{className:"text-sm text-gray-400",children:c("admin.backup.noStoredBackups","No stored backups")}):(0,d.jsx)("div",{className:"space-y-2",children:ek.map(a=>(0,d.jsxs)("div",{className:"flex items-center justify-between py-2 px-3 bg-gray-50 rounded-lg border border-gray-100",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium text-gray-800",children:"backup_today"===a.name?c("admin.backup.today","Today"):c("admin.backup.yesterday","Yesterday")}),(0,d.jsxs)("p",{className:"text-xs text-gray-400",children:[c("admin.backup.size","Size"),": ",(a.size/1024).toFixed(1)," KB \xb7 ",c("admin.backup.date","Date"),": ",new Date(a.date).toLocaleString()]})]}),(0,d.jsx)("button",{disabled:eq===a.name,onClick:async()=>{if(window.confirm(c("admin.backup.restoreConfirm","Restore from this backup?"))){er(a.name);try{await (0,k.Em)("/admin/backup/restore",{method:"POST",body:JSON.stringify({name:a.name})}),ew(c("admin.backup.restoreSuccess","Restore successful"))}catch(a){ex(a.message||"Error")}er(null)}},className:"text-sm text-green-600 hover:text-gray-800 font-medium disabled:opacity-50",children:eq===a.name?c("admin.backup.restoring","Restoring..."):c("admin.backup.restore","Restore")})]},a.name))})]}),(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,d.jsx)("h3",{className:"font-semibold text-gray-800 text-sm mb-4",children:c("admin.backup.tables","Tables")}),ei?(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[(0,d.jsxs)("svg",{className:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,d.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]}),c("common.loading","Loading...")]}):0===eg.length?(0,d.jsx)("p",{className:"text-sm text-gray-400",children:c("admin.noData","No data")}):(0,d.jsx)("div",{className:"overflow-x-auto",children:(0,d.jsx)("table",{className:"w-full text-sm",children:(0,d.jsx)("tbody",{className:"divide-y divide-gray-100",children:eg.map(a=>(0,d.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,d.jsx)("td",{className:"py-2 pr-4 font-mono text-gray-700",children:a}),(0,d.jsx)("td",{className:"py-2 text-right",children:(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)("button",{onClick:async()=>{try{let b=await fetch(`https://api.canhelp.gr/api/admin/backup/export/${a}`,{credentials:"include"});if(!b.ok)throw Error("Export failed");let c=await b.blob(),d=URL.createObjectURL(c),e=document.createElement("a");e.href=d,e.download=`${a}_${new Date().toISOString().slice(0,10)}.sql.gz`,e.click(),URL.revokeObjectURL(d)}catch(a){ex(a.message||"Error")}},className:"text-green-600 hover:text-gray-800 font-medium text-xs px-2 py-1 rounded border border-green-200 hover:bg-green-50",children:c("admin.backup.exportTable","Export")}),(0,d.jsxs)("label",{className:"text-gray-600 hover:text-gray-800 font-medium text-xs px-2 py-1 rounded border border-gray-200 hover:bg-gray-100 cursor-pointer",children:[eo===a?c("admin.backup.importing","Importing..."):c("admin.backup.importTable","Import"),(0,d.jsx)("input",{type:"file",accept:".sql.gz,.gz",className:"hidden",onChange:async b=>{let d=b.target.files?.[0];if(d&&window.confirm(c("admin.backup.restoreConfirm","Restore from this backup?"))){ep(a);try{let b=new FormData;b.append("file",d);let e=await fetch(`https://api.canhelp.gr/api/admin/backup/import/${a}`,{method:"POST",credentials:"include",body:b});if(!e.ok){let a=await e.json().catch(()=>({error:"Import failed"}));throw Error(a.error||"Import failed")}ew(c("admin.backup.importSuccess","Import successful"))}catch(a){ex(a.message||"Error")}ep(null),b.target.value=""}}})]})]})})]},a))})})})]})]}),"translations"===n&&(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-base font-semibold text-gray-900",children:"Переводы"}),(0,d.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:"Автоматический перевод пропущенных значений по таблицам"})]}),(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 flex flex-wrap gap-4 items-end",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Источник"}),(0,d.jsxs)("select",{value:eE,onChange:a=>eF(a.target.value),className:"text-sm border border-gray-200 rounded-lg px-3 py-1.5 focus:outline-none focus:ring-2 focus:ring-green-500",children:[(0,d.jsx)("option",{value:"el",children:"\uD83C\uDDEC\uD83C\uDDF7 Greek"}),(0,d.jsx)("option",{value:"en",children:"\uD83C\uDDEC\uD83C\uDDE7 English"}),(0,d.jsx)("option",{value:"ru",children:"\uD83C\uDDF7\uD83C\uDDFA Russian"}),(0,d.jsx)("option",{value:"uk",children:"\uD83C\uDDFA\uD83C\uDDE6 Ukrainian"})]})]}),(0,d.jsx)("svg",{className:"w-5 h-5 text-gray-400 mb-1 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 7l5 5-5 5M6 12h12"})}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Перевести на"}),(0,d.jsxs)("select",{value:eC,onChange:a=>eD(a.target.value),className:"text-sm border border-gray-200 rounded-lg px-3 py-1.5 focus:outline-none focus:ring-2 focus:ring-green-500",children:[(0,d.jsx)("option",{value:"el",children:"\uD83C\uDDEC\uD83C\uDDF7 Greek"}),(0,d.jsx)("option",{value:"en",children:"\uD83C\uDDEC\uD83C\uDDE7 English"}),(0,d.jsx)("option",{value:"ru",children:"\uD83C\uDDF7\uD83C\uDDFA Russian"}),(0,d.jsx)("option",{value:"uk",children:"\uD83C\uDDFA\uD83C\uDDE6 Ukrainian"})]})]}),(0,d.jsx)("div",{className:"ml-auto self-end",children:(0,d.jsxs)("span",{className:"text-sm font-semibold text-gray-700 flex items-center gap-2",children:[{el:"\uD83C\uDDEC\uD83C\uDDF7",en:"\uD83C\uDDEC\uD83C\uDDE7",ru:"\uD83C\uDDF7\uD83C\uDDFA",uk:"\uD83C\uDDFA\uD83C\uDDE6"}[eE]," ",eE.toUpperCase(),(0,d.jsx)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 7l5 5-5 5M6 12h12"})}),{el:"\uD83C\uDDEC\uD83C\uDDF7",en:"\uD83C\uDDEC\uD83C\uDDE7",ru:"\uD83C\uDDF7\uD83C\uDDFA",uk:"\uD83C\uDDFA\uD83C\uDDE6"}[eC]," ",eC.toUpperCase()]})})]}),eI&&(0,d.jsx)("div",{className:`text-sm px-4 py-2 rounded-lg ${eI.error?"bg-red-50 text-red-700":"bg-green-50 text-green-700"}`,children:eI.text}),eA?(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-400 py-6",children:[(0,d.jsxs)("svg",{className:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,d.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]}),"Загрузка…"]}):(0,d.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:(ey??[]).map(a=>{let b="tasks"===a.name,c=Object.values(a.missing).reduce((a,b)=>a+b,0),e=b?c:a.missing[eC]??0,f=!!eG[a.name],g=Object.values(eG).some(Boolean);return(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5 flex flex-col",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"font-semibold text-gray-900 text-sm",children:a.label}),(0,d.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:a.name})]}),(0,d.jsx)("span",{className:`text-xs font-semibold px-2 py-0.5 rounded-full ${e>0?"bg-red-100 text-red-700":"bg-green-100 text-green-700"}`,children:e>0?`${e} missing`:"Complete"})]}),(0,d.jsxs)("p",{className:"text-xs text-gray-500 mt-3",children:["Всего: ",a.total,b&&" \xb7 с языка оригинала на все остальные"]}),(0,d.jsx)("div",{className:"mt-2 flex flex-wrap gap-1",children:["el","en","ru","uk"].map(c=>{let e=a.missing[c]??0,f=b&&e>0;return(0,d.jsxs)("button",{type:"button",disabled:!f,onClick:f?async()=>{eL({lang:c,loading:!0,rows:[]});try{let a=await k.QY(c,50);eL({lang:c,loading:!1,rows:a.rows})}catch{eL({lang:c,loading:!1,rows:[]})}}:void 0,className:`text-xs px-2 py-0.5 rounded-full border transition ${e>0?"border-red-200 bg-red-50 text-red-600"+(f?" cursor-pointer hover:bg-red-100":""):"border-green-200 bg-green-50 text-green-600 cursor-default"}`,children:[c,": ",e>0?`-${e}`:"✓"]},c)})}),(0,d.jsx)("div",{className:"mt-4 mt-auto pt-4",children:0===e?(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-emerald-600",children:[(0,d.jsx)("svg",{className:"w-3.5 h-3.5 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),"Все переводы заполнены"]}):(0,d.jsx)("button",{disabled:g,onClick:async()=>{if(!b&&eE===eC)return void eJ({text:"Исходный и целевой язык совпадают",error:!0});eH(b=>({...b,[a.name]:!0})),eJ(null);try{let c=b?await k.I(500):"email_templates"===a.name?await k.fu(eC,eE):await k.cp(a.name,eC,eE,500);eJ({text:`${a.label}: translated ${c.translated} of ${c.total}`+(c.failed>0?` \xb7 errors: ${c.failed}`:""),error:c.failed>0&&0===c.translated}),k.YQ().then(a=>ez(a.tables)).catch(()=>{})}catch(b){let a=b?.response?await b.response.text().catch(()=>b.message):b.message||"Error";eJ({text:`Error: ${a}`,error:!0})}finally{eH(b=>{let c={...b};return delete c[a.name],c})}},className:"w-full text-sm px-3 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 disabled:opacity-50 flex items-center justify-center gap-2 transition font-medium",children:f?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("svg",{className:"w-3.5 h-3.5 animate-spin flex-shrink-0",fill:"none",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,d.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]}),"Translating..."]}):b?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("svg",{className:"w-3.5 h-3.5 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.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"})}),"Fill all missing \xb7 ",e]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("svg",{className:"w-3.5 h-3.5 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.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"})}),"Translate ",e," \xb7 ",{el:"\uD83C\uDDEC\uD83C\uDDF7",en:"\uD83C\uDDEC\uD83C\uDDE7",ru:"\uD83C\uDDF7\uD83C\uDDFA",uk:"\uD83C\uDDFA\uD83C\uDDE6"}[eE]," ",eE.toUpperCase(),(0,d.jsx)("svg",{className:"w-3 h-3 opacity-60 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 7l5 5-5 5M6 12h12"})}),{el:"\uD83C\uDDEC\uD83C\uDDF7",en:"\uD83C\uDDEC\uD83C\uDDE7",ru:"\uD83C\uDDF7\uD83C\uDDFA",uk:"\uD83C\uDDFA\uD83C\uDDE6"}[eC]," ",eC.toUpperCase()]})})})]},a.name)})})]}),"dbcheck"===n&&(0,d.jsx)(x,{}),"referrals"===n&&(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsx)("div",{className:"grid grid-cols-3 gap-4",children:[{label:"Рефереров",value:eM?.totalReferrers??"—",color:"text-green-600"},{label:"Приглашений",value:eM?.totalReferrals??"—",color:"text-purple-600"},{label:"Активных наград",value:eM?.activeRewards??"—",color:"text-green-600"}].map(({label:a,value:b,color:c})=>(0,d.jsxs)("div",{className:"bg-white rounded-2xl border border-gray-200 p-5 text-center",children:[(0,d.jsx)("div",{className:`text-3xl font-bold ${c}`,children:b}),(0,d.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:a})]},a))}),(0,d.jsxs)("div",{className:"bg-white rounded-2xl border border-gray-200 overflow-hidden",children:[(0,d.jsxs)("div",{className:"px-5 py-4 border-b border-gray-100 flex items-center justify-between",children:[(0,d.jsx)("h2",{className:"font-semibold text-gray-800",children:"Дерево рефералов"}),(0,d.jsxs)("button",{onClick:()=>{eP(!0),k.cJ().then(eN).catch(()=>{}).finally(()=>eP(!1))},className:"text-xs text-green-600 hover:underline flex items-center gap-1",children:[eO&&(0,d.jsxs)("svg",{className:"w-3 h-3 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,d.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]}),"Обновить"]})]}),eO&&!eM?(0,d.jsx)("div",{className:"flex justify-center py-16",children:(0,d.jsxs)("svg",{className:"w-6 h-6 animate-spin text-purple-600",fill:"none",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,d.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]})}):eM&&0!==eM.tree.length?(0,d.jsx)("div",{className:"divide-y divide-gray-100",children:eM.tree.map(a=>{let b=a.referrer?.id??"unknown",c=eQ.has(b),e=a.referrer?`${a.referrer.firstName??""} ${a.referrer.lastName??""}`.trim()||a.referrer.email:"(удалён)";return(0,d.jsxs)("div",{children:[(0,d.jsxs)("button",{className:"w-full flex items-center gap-3 px-5 py-3.5 hover:bg-gray-50 text-left transition-colors",onClick:()=>eR(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c}),children:[(0,d.jsx)("svg",{className:`w-4 h-4 text-gray-400 flex-shrink-0 transition-transform ${c?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("span",{className:"font-medium text-sm text-gray-900",children:e}),a.referrer&&(0,d.jsx)("span",{className:"ml-2 text-xs text-gray-400",children:a.referrer.email})]}),a.referrer?.referralCode&&(0,d.jsx)("code",{className:"text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded font-mono",children:a.referrer.referralCode}),(0,d.jsxs)("span",{className:"ml-3 text-xs font-semibold text-purple-700 bg-purple-50 px-2 py-0.5 rounded-full",children:[a.referees.length," реф."]})]}),c&&(0,d.jsx)("div",{className:"bg-gray-50 border-t border-gray-100",children:(0,d.jsxs)("table",{className:"w-full text-xs",children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{className:"border-b border-gray-200",children:[(0,d.jsx)("th",{className:"text-left px-10 py-2 font-semibold text-gray-500",children:"Приглашённый"}),(0,d.jsx)("th",{className:"text-left px-3 py-2 font-semibold text-gray-500",children:"Email"}),(0,d.jsx)("th",{className:"text-center px-3 py-2 font-semibold text-gray-500",children:"+дней"}),(0,d.jsx)("th",{className:"text-center px-3 py-2 font-semibold text-gray-500",children:"Истекает"}),(0,d.jsx)("th",{className:"text-center px-3 py-2 font-semibold text-gray-500",children:"Дата"})]})}),(0,d.jsx)("tbody",{children:a.referees.map(a=>{let b=`${a.firstName??""} ${a.lastName??""}`.trim()||a.email,c=new Date(a.expiresAt),e=new Date(a.createdAt),f=c>new Date;return(0,d.jsxs)("tr",{className:"border-b border-gray-100 last:border-0 hover:bg-white transition-colors",children:[(0,d.jsx)("td",{className:"px-10 py-2.5 font-medium text-gray-800",children:b}),(0,d.jsx)("td",{className:"px-3 py-2.5 text-gray-500",children:a.email}),(0,d.jsx)("td",{className:"px-3 py-2.5 text-center",children:(0,d.jsxs)("span",{className:"font-semibold text-green-700",children:["+",a.daysAdded]})}),(0,d.jsx)("td",{className:"px-3 py-2.5 text-center",children:(0,d.jsx)("span",{className:`px-1.5 py-0.5 rounded text-xs font-medium ${f?"bg-green-100 text-green-700":"bg-gray-100 text-gray-500"}`,children:c.toLocaleDateString("ru-RU",{day:"2-digit",month:"2-digit",year:"2-digit"})})}),(0,d.jsx)("td",{className:"px-3 py-2.5 text-center text-gray-400",children:e.toLocaleDateString("ru-RU",{day:"2-digit",month:"2-digit",year:"2-digit"})})]},a.id)})})]})})]},b)})}):(0,d.jsx)("div",{className:"py-16 text-center text-sm text-gray-400",children:"Нет данных о рефералах"})]})]}),eK&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4",onClick:()=>eL(null),children:(0,d.jsxs)("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-3xl max-h-[80vh] flex flex-col",onClick:a=>a.stopPropagation(),children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("h3",{className:"font-semibold text-gray-900",children:["Задачи без перевода: ",(0,d.jsx)("span",{className:"uppercase font-bold text-red-600",children:eK.lang})]}),(0,d.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:"Показаны первые 50 записей"})]}),(0,d.jsx)("button",{onClick:()=>eL(null),className:"text-gray-400 hover:text-gray-600 p-1",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,d.jsx)("div",{className:"overflow-y-auto flex-1 px-6 py-4",children:eK.loading?(0,d.jsx)("div",{className:"flex justify-center py-12",children:(0,d.jsxs)("svg",{className:"w-6 h-6 animate-spin text-purple-600",fill:"none",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,d.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]})}):0===eK.rows.length?(0,d.jsx)("p",{className:"text-sm text-gray-500 text-center py-12",children:"Нет задач без перевода"}):(0,d.jsxs)("table",{className:"w-full text-xs border-collapse",children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{className:"border-b border-gray-200",children:[(0,d.jsx)("th",{className:"text-left py-2 pr-3 font-semibold text-gray-600 w-[35%]",children:"Оригинал (title)"}),(0,d.jsx)("th",{className:"text-center py-2 px-2 font-semibold text-gray-600",children:"orig"}),["el","en","ru","uk"].map(a=>(0,d.jsx)("th",{className:"text-center py-2 px-2 font-semibold text-gray-600 w-[14%]",children:a},a))]})}),(0,d.jsx)("tbody",{children:eK.rows.map(a=>(0,d.jsxs)("tr",{className:"border-b border-gray-100 hover:bg-gray-50",children:[(0,d.jsx)("td",{className:"py-2 pr-3 text-gray-800 truncate max-w-[200px]",title:a.title,children:a.title}),(0,d.jsx)("td",{className:"py-2 px-2 text-center",children:(0,d.jsx)("span",{className:"uppercase font-semibold text-purple-700 bg-purple-50 px-1.5 py-0.5 rounded",children:a.originalLocale})}),[["el",a.titleEl],["en",a.titleEn],["ru",a.titleRu],["uk",a.titleUk]].map(([a,b])=>(0,d.jsx)("td",{className:"py-2 px-2 text-center",title:b??"",children:b?(0,d.jsx)("span",{className:"text-emerald-600 font-semibold",children:"✓"}):(0,d.jsx)("span",{className:"text-red-500 font-semibold",children:"✗"})},a))]},a.id))})]})})]})}),b1&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4",children:(0,d.jsxs)("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-4xl max-h-[90vh] flex flex-col",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-base font-semibold text-gray-900",children:c("admin.user_edit.title")}),(0,d.jsxs)("p",{className:"text-xs text-gray-400 mt-0.5",children:[b1.email," \xb7 ID: ",b1.id]})]}),(0,d.jsx)("button",{onClick:()=>b2(null),className:"text-gray-400 hover:text-gray-600 text-2xl leading-none",children:"\xd7"})]}),(0,d.jsxs)("div",{className:"flex flex-1 min-h-0",children:[(0,d.jsx)("nav",{className:"w-44 flex-shrink-0 border-r border-gray-100 py-3 space-y-0.5 px-2",children:[{id:"profile",label:c("admin.user_edit.tab.profile")},{id:"account",label:c("admin.user_edit.tab.account")},{id:"balance",label:c("admin.user_edit.tab.balance")},{id:"settings",label:c("admin.user_edit.tab.settings")},{id:"site",label:c("admin.user_edit.tab.site")},{id:"specialist",label:c("admin.user_edit.tab.specialist")}].map(a=>(0,d.jsx)("button",{onClick:()=>{if(b8(a.id),"specialist"===a.id&&b1){cg(!0);let a=k.vy(b1.id).then(ce).catch(()=>{});Promise.all([a,0===cD.length?k.KD().then(cE).catch(()=>{}):Promise.resolve(),0===cv.length?k.k_().then(cw).catch(()=>{}):Promise.resolve()]).finally(()=>cg(!1))}},className:`w-full text-left px-3 py-2.5 text-sm rounded-lg transition-colors ${b7===a.id?"bg-green-50 text-green-700 font-medium":"text-gray-600 hover:bg-gray-50"}`,children:a.label},a.id))}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto p-6",children:["profile"===b7&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"p-3 bg-gray-50 rounded-lg text-xs text-gray-500 space-y-0.5",children:[(0,d.jsxs)("p",{children:[(0,d.jsxs)("span",{className:"font-medium",children:[c("admin.user_edit.registered"),":"]})," ",new Date(b1.createdAt).toLocaleDateString(fM)]}),b1.lastSeenAt&&(0,d.jsxs)("p",{children:[(0,d.jsxs)("span",{className:"font-medium",children:[c("admin.user_edit.last_seen"),":"]})," ",new Date(b1.lastSeenAt).toLocaleDateString(fM)]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.user_edit.first_name")}),(0,d.jsx)("input",{value:b1.firstName??"",onChange:a=>b2(b=>({...b,firstName:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.user_edit.last_name")}),(0,d.jsx)("input",{value:b1.lastName??"",onChange:a=>b2(b=>({...b,lastName:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.user_edit.phone")}),(0,d.jsx)("input",{value:b1.phone??"",onChange:a=>b2(b=>({...b,phone:a.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,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.user_edit.bio")}),(0,d.jsx)("textarea",{value:b1.bio??"",onChange:a=>b2(b=>({...b,bio:a.target.value})),rows:5,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"})]})]}),"account"===b7&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.user_edit.email")}),(0,d.jsx)("div",{className:"w-full border border-gray-200 bg-gray-50 rounded-lg px-3 py-2 text-sm text-gray-600 select-all",children:b1.email})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between rounded-lg border px-3 py-2 bg-gray-50",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[b1.emailVerified?(0,d.jsx)("svg",{className:"w-4 h-4 text-green-500 shrink-0",viewBox:"0 0 20 20",fill:"currentColor",children:(0,d.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"})}):(0,d.jsx)("svg",{className:"w-4 h-4 text-red-400 shrink-0",viewBox:"0 0 20 20",fill:"currentColor",children:(0,d.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L10 8.586 7.707 6.293a1 1 0 00-1.414 1.414L8.586 10l-2.293 2.293a1 1 0 101.414 1.414L10 11.414l2.293 2.293a1 1 0 001.414-1.414L11.414 10l2.293-2.293z",clipRule:"evenodd"})}),(0,d.jsx)("span",{className:`text-sm font-medium ${b1.emailVerified?"text-green-700":"text-red-600"}`,children:b1.emailVerified?c("admin.user_edit.email_verified"):c("admin.user_edit.email_not_verified")})]}),!b1.emailVerified&&(0,d.jsx)("button",{onClick:fg,disabled:b5,className:"text-xs px-3 py-1 rounded-md bg-green-600 text-white hover:bg-green-700 disabled:opacity-50 transition-colors",children:b5?"...":c("admin.user_edit.verify_email_btn")})]}),(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.user_edit.role")}),(0,d.jsxs)("select",{value:b1.role,onChange:a=>b2(b=>({...b,role:a.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,d.jsx)("option",{value:"user",children:c("admin.user_edit.role.user")}),(0,d.jsx)("option",{value:"admin",children:c("admin.user_edit.role.admin")})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.user_edit.plan")}),(0,d.jsxs)("select",{value:b1.planId??"",onChange:a=>b2(b=>({...b,planId:a.target.value||null})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,d.jsx)("option",{value:"",children:c("admin.user_edit.no_plan")}),cp.map(a=>(0,d.jsx)("option",{value:a.id,children:a.name},a.id))]})]})]}),b1.planExpiresAt&&(0,d.jsxs)("p",{className:"text-xs text-gray-500",children:[c("admin.user_edit.plan_expires"),": ",new Date(b1.planExpiresAt).toLocaleDateString(fM)]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,d.jsx)("input",{type:"checkbox",checked:!1!==b1.isActive,onChange:a=>b2(b=>({...b,isActive:a.target.checked})),className:"w-4 h-4 rounded border-gray-300 text-green-600"}),(0,d.jsx)("span",{className:"text-sm text-gray-700",children:c("admin.user_edit.active")})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.user_edit.interface_lang")}),(0,d.jsxs)("select",{value:b1.locale??"el",onChange:a=>b2(b=>({...b,locale:a.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,d.jsx)("option",{value:"el",children:"Ελληνικά"}),(0,d.jsx)("option",{value:"en",children:"English"}),(0,d.jsx)("option",{value:"ru",children:"Русский"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:c("admin.user_edit.comm_languages")}),(0,d.jsx)("div",{className:"flex gap-5",children:["el","en","uk","ru"].map(a=>(0,d.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[(0,d.jsx)("input",{type:"checkbox",checked:(b1.languages??[]).includes(a),onChange:b=>{let c=b1.languages??[];b2(d=>({...d,languages:b.target.checked?[...c.filter(b=>b!==a),a]:c.filter(b=>b!==a)}))},className:"w-4 h-4 rounded border-gray-300 text-green-600"}),(0,d.jsx)("span",{className:"text-sm text-gray-700",children:"el"===a?"Ελληνικά":"en"===a?"English":"uk"===a?"Українська":"Русский"})]},a))})]})]}),"balance"===b7&&(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between p-5 bg-gray-50 rounded-xl border border-gray-200",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:c("admin.user_edit.balance")}),(0,d.jsxs)("div",{className:"text-2xl font-bold text-gray-900",children:[Number(b1.balance??0).toFixed(2)," EUR"]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsxs)("button",{onClick:()=>ca("topup"),className:"flex items-center gap-1.5 px-4 py-2 bg-emerald-600 hover:bg-emerald-700 text-white rounded-lg text-sm font-medium",children:[(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),c("admin.balance.topup.btn")]}),(0,d.jsxs)("button",{onClick:()=>ca("withdraw"),className:"flex items-center gap-1.5 px-4 py-2 bg-rose-600 hover:bg-rose-700 text-white rounded-lg text-sm font-medium",children:[(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 12H4"})}),c("admin.balance.withdraw.btn")]})]})]}),(0,d.jsx)("p",{className:"text-xs text-center text-gray-400",children:c("admin.balance.modal_hint")})]}),"settings"===b7&&(0,d.jsx)("div",{className:"space-y-4",children:(0,d.jsxs)("div",{className:"space-y-3 pt-1 divide-y divide-gray-100",children:[(0,d.jsxs)("label",{className:"flex items-center justify-between cursor-pointer py-2",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-sm font-medium text-gray-700",children:c("admin.user_edit.show_contact_info")}),(0,d.jsx)("div",{className:"text-xs text-gray-400",children:c("admin.user_edit.show_contact_info.hint")})]}),(0,d.jsx)("input",{type:"checkbox",checked:b1.showContactInfo??!1,onChange:a=>b2(b=>({...b,showContactInfo:a.target.checked})),className:"w-4 h-4 rounded border-gray-300 text-green-600"})]}),(0,d.jsxs)("label",{className:"flex items-center justify-between cursor-pointer py-2",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-sm font-medium text-gray-700",children:c("admin.user_edit.notify_new_tasks")}),(0,d.jsx)("div",{className:"text-xs text-gray-400",children:c("admin.user_edit.notify_new_tasks.hint")})]}),(0,d.jsx)("input",{type:"checkbox",checked:b1.notifyNewTasks??!1,onChange:a=>b2(b=>({...b,notifyNewTasks:a.target.checked})),className:"w-4 h-4 rounded border-gray-300 text-green-600"})]}),(0,d.jsxs)("label",{className:"flex items-center justify-between cursor-pointer py-2",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-sm font-medium text-gray-700",children:c("admin.user_edit.notif_messages")}),(0,d.jsx)("div",{className:"text-xs text-gray-400",children:c("admin.user_edit.notif_messages.hint")})]}),(0,d.jsx)("input",{type:"checkbox",checked:b1.notifMessages??!0,onChange:a=>b2(b=>({...b,notifMessages:a.target.checked})),className:"w-4 h-4 rounded border-gray-300 text-green-600"})]})]})}),"site"===b7&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:c("admin.user_edit.personal_site_slug")}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("div",{className:"flex flex-1 items-center border border-gray-300 rounded-lg overflow-hidden focus-within:ring-2 focus-within:ring-blue-400",children:[(0,d.jsx)("span",{className:"px-3 py-2 text-sm text-gray-400 bg-gray-50 border-r border-gray-300 flex-shrink-0",children:"canhelp.gr/site/"}),(0,d.jsx)("input",{value:b1.personalSiteSlug??"",onChange:a=>b2(b=>({...b,personalSiteSlug:a.target.value||null})),placeholder:"my-username",className:"flex-1 px-3 py-2 text-sm focus:outline-none"})]}),b1.personalSiteSlug&&(0,d.jsx)("a",{href:`/site/${b1.personalSiteSlug}`,target:"_blank",rel:"noopener noreferrer",className:"shrink-0 px-3 py-2 border border-gray-300 rounded-lg text-sm text-green-600 hover:bg-green-50 flex items-center gap-1",children:(0,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})})]})]}),b1.personalSiteSlug&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("h4",{className:"text-sm font-semibold text-gray-800 pt-3 border-t border-gray-100",children:c("profile.site.visible_title")}),(0,d.jsx)("div",{className:"space-y-1",children:[{key:"showBio",label:c("profile.site.visible.bio")},{key:"showRating",label:c("profile.site.visible.rating")},{key:"showServices",label:c("profile.site.visible.services")},{key:"showPortfolio",label:c("profile.site.visible.portfolio")},{key:"showReviews",label:c("profile.site.visible.reviews")},{key:"showPhone",label:c("profile.site.visible.contacts")},{key:"showFullLastName",label:c("profile.site.visible.full_last_name")},{key:"showStatus",label:c("profile.site.visible.status")}].map(a=>(0,d.jsxs)("label",{className:"flex items-center justify-between cursor-pointer py-1.5",children:[(0,d.jsx)("span",{className:"text-sm text-gray-700",children:a.label}),(0,d.jsx)("input",{type:"checkbox",checked:!1!==(b1.siteSettings??{})[a.key],onChange:b=>b2(c=>({...c,siteSettings:{...c.siteSettings??{},[a.key]:b.target.checked}})),className:"w-4 h-4 rounded border-gray-300 text-green-600"})]},a.key))}),(0,d.jsxs)("div",{className:"pt-2",children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:c("profile.site.theme")}),(0,d.jsxs)("select",{value:(b1.siteSettings??{}).siteTheme??"dark",onChange:a=>b2(b=>({...b,siteSettings:{...b.siteSettings??{},siteTheme:a.target.value}})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,d.jsx)("option",{value:"dark",children:c("profile.site.theme.dark")}),(0,d.jsx)("option",{value:"light",children:c("profile.site.theme.light")})]})]})]})]}),"specialist"===b7&&(0,d.jsxs)("div",{className:"space-y-6",children:[(()=>{if(b1?.role==="specialist")return null;let a=String(b1?.bio??"").trim(),b=(cd??[]).filter(a=>(a.publicationStatus??(a.isActive?"active":"inactive"))==="active"),e=b.length>0,f=b.some(a=>(a.categories?.length??0)>0),g=b.some(a=>(a.locations?.length??0)>0),h=[];return(a||h.push(c("admin.user_edit.visibility_requirements.bio","Fill in bio")),e||h.push(c("admin.user_edit.visibility_requirements.published_card","Publish at least one card")),f||h.push(c("admin.user_edit.visibility_requirements.categories","Add a category in a published card")),g||h.push(c("admin.user_edit.visibility_requirements.locations","Add a location in a published card")),0===h.length)?null:(0,d.jsxs)("div",{className:"rounded-xl border border-amber-300 bg-amber-50 p-3",children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-amber-900",children:c("admin.user_edit.visibility_requirements.title","Profile is not yet visible in Offers")}),(0,d.jsx)("p",{className:"text-xs text-amber-800 mt-1",children:c("admin.user_edit.visibility_requirements.hint","Visibility requirements to complete:")}),(0,d.jsx)("ul",{className:"mt-2 text-xs text-amber-900 list-disc pl-5 space-y-0.5",children:h.map(a=>(0,d.jsx)("li",{children:a},a))})]})})(),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:c("admin.user_edit.skills")}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-2 min-h-[28px]",children:(b1.skills??[]).map(a=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs bg-green-50 text-green-700 px-2 py-0.5 rounded-full",children:[a,(0,d.jsx)("button",{onClick:()=>b2(b=>({...b,skills:(b.skills??[]).filter(b=>b!==a)})),className:"text-gray-400 hover:text-green-700 leading-none",children:"\xd7"})]},a))}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("input",{value:cb,onChange:a=>cc(a.target.value),onKeyDown:a=>{if(("Enter"===a.key||","===a.key)&&cb.trim()){a.preventDefault();let b=cb.trim().replace(/,$/,"");b&&!(b1.skills??[]).includes(b)&&b2(a=>({...a,skills:[...a.skills??[],b]})),cc("")}},placeholder:c("admin.user_edit.skill_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,d.jsx)("button",{onClick:()=>{let a=cb.trim();a&&!(b1.skills??[]).includes(a)&&b2(b=>({...b,skills:[...b.skills??[],a]})),cc("")},className:"px-3 py-2 bg-green-600 text-white rounded-lg text-sm hover:bg-green-700",children:c("common.add")})]})]}),(0,d.jsxs)("div",{className:"border-t border-gray-100 pt-4",children:[(0,d.jsx)("div",{className:"text-sm font-medium text-gray-700 mb-3",children:c("admin.user_edit.specialist_cards")}),cf?(0,d.jsx)("p",{className:"text-xs text-gray-400 py-2",children:c("common.loading")}):0===cd.length?(0,d.jsx)("p",{className:"text-xs text-gray-400 py-4 text-center",children:c("admin.user_edit.no_cards")}):(0,d.jsx)("div",{className:"space-y-4",children:cd.map(a=>(0,d.jsxs)("div",{className:"border border-gray-200 bg-gray-50 rounded-xl p-4 space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("input",{value:a.title??"",onChange:b=>ce(c=>c.map(c=>c.id===a.id?{...c,title:b.target.value}:c)),placeholder:c("admin.user_edit.card_title"),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,d.jsxs)("select",{value:a.publicationStatus??(a.isActive?"active":"inactive"),onChange:b=>ce(c=>c.map(c=>c.id===a.id?{...c,publicationStatus:b.target.value,isActive:"active"===b.target.value}:c)),className:"rounded-lg border border-gray-300 bg-white px-2 py-2 text-xs text-gray-700",children:[(0,d.jsx)("option",{value:"inactive",children:c("admin.moderation.inactive","Draft")}),(0,d.jsx)("option",{value:"pending",children:c("admin.moderation.pending","Under review")}),(0,d.jsx)("option",{value:"active",children:c("admin.moderation.active","Active")})]})]}),(0,d.jsx)("textarea",{value:a.description??"",onChange:b=>ce(c=>c.map(c=>c.id===a.id?{...c,description:b.target.value}:c)),rows:3,placeholder:c("admin.user_edit.card_description"),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,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-xs font-medium text-gray-500 mb-1.5",children:c("admin.user_edit.skills")}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]",children:(a.skills??[]).map(b=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs bg-green-50 text-green-700 px-2 py-0.5 rounded-full",children:[b,(0,d.jsx)("button",{onClick:()=>ce(c=>c.map(c=>c.id===a.id?{...c,skills:(c.skills??[]).filter(a=>a!==b)}:c)),className:"text-gray-400 hover:text-green-700 leading-none",children:"\xd7"})]},b))}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("input",{value:ch[a.id]??"",onChange:b=>ci(c=>({...c,[a.id]:b.target.value})),onKeyDown:b=>{if(("Enter"===b.key||","===b.key)&&(ch[a.id]??"").trim()){b.preventDefault();let c=(ch[a.id]??"").trim().replace(/,$/,"");c&&!(a.skills??[]).includes(c)&&ce(b=>b.map(b=>b.id===a.id?{...b,skills:[...b.skills??[],c]}:b)),ci(b=>({...b,[a.id]:""}))}},placeholder:c("admin.user_edit.skill_placeholder"),className:"flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-xs focus:outline-none focus:ring-2 focus:ring-blue-400"}),(0,d.jsx)("button",{onClick:()=>{let b=(ch[a.id]??"").trim();b&&!(a.skills??[]).includes(b)&&ce(c=>c.map(c=>c.id===a.id?{...c,skills:[...c.skills??[],b]}:c)),ci(b=>({...b,[a.id]:""}))},className:"px-2.5 py-1.5 bg-green-600 text-white rounded-lg text-xs hover:bg-green-700",children:"+"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-xs font-medium text-gray-500 mb-1.5",children:c("admin.user_edit.categories")}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]",children:(a.categories??[]).map(b=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs bg-purple-50 text-purple-700 px-2 py-0.5 rounded-full",children:[r(cD.find(a=>a.slug===b)??{slug:b},g),(0,d.jsx)("button",{onClick:()=>ce(c=>c.map(c=>c.id===a.id?{...c,categories:(c.categories??[]).filter(a=>a!==b)}:c)),className:"text-purple-400 hover:text-purple-700 leading-none",children:"\xd7"})]},b))}),(0,d.jsx)(u,{catRows:cD,locale:g,selected:a.categories??[],onAdd:b=>ce(c=>c.map(c=>c.id===a.id?{...c,categories:[...c.categories??[],b]}:c)),addLabel:c("admin.user_edit.add_category")})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-xs font-medium text-gray-500 mb-1.5",children:c("admin.user_edit.locations")}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]",children:(a.locations??[]).map(b=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs bg-green-50 text-green-700 px-2 py-0.5 rounded-full",children:[s(cv.find(a=>a.slug===b)??{slug:b},g),(0,d.jsx)("button",{onClick:()=>ce(c=>c.map(c=>c.id===a.id?{...c,locations:(c.locations??[]).filter(a=>a!==b)}:c)),className:"text-green-400 hover:text-green-700 leading-none",children:"\xd7"})]},b))}),(0,d.jsx)(v,{locRows:cv,locale:g,selected:a.locations??[],onAdd:b=>ce(c=>c.map(c=>c.id===a.id?{...c,locations:[...c.locations??[],b]}:c)),addLabel:c("admin.user_edit.add_location")})]}),(0,d.jsx)("div",{className:"flex justify-end pt-1",children:(0,d.jsx)("button",{onClick:()=>fj(a.id),disabled:cj[a.id],className:"px-4 py-1.5 bg-green-600 hover:bg-green-700 text-white rounded-lg text-xs font-medium disabled:opacity-50",children:cj[a.id]?"...":c("common.save")})})]},a.id))})]})]})]})]}),"balance"!==b7?(0,d.jsxs)("div",{className:"border-t border-gray-100 px-6 py-4 flex gap-3 flex-shrink-0",children:[(0,d.jsx)("button",{onClick:ff,disabled:b3,className:"flex-1 bg-green-600 hover:bg-green-700 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50",children:b3?"...":c("common.save")}),(0,d.jsx)("button",{onClick:()=>b2(null),className:"flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium",children:c("common.cancel")})]}):(0,d.jsx)("div",{className:"border-t border-gray-100 px-6 py-4 flex-shrink-0",children:(0,d.jsx)("button",{onClick:()=>b2(null),className:"w-full bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium",children:c("common.close")})})]})}),b1&&b9&&(0,d.jsx)("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/40 px-4",children:(0,d.jsxs)("div",{className:`bg-white rounded-2xl shadow-2xl p-6 w-full max-w-sm border-t-4 ${"topup"===b9?"border-emerald-500":"border-rose-500"}`,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsx)("h3",{className:`text-base font-semibold ${"topup"===b9?"text-emerald-900":"text-rose-900"}`,children:"topup"===b9?c("admin.balance.topup.title"):c("admin.balance.withdraw.title")}),(0,d.jsx)("button",{onClick:()=>ca(null),className:"text-gray-400 hover:text-gray-600 text-2xl leading-none",children:"\xd7"})]}),(0,d.jsxs)("p",{className:"text-xs text-gray-500 mb-4",children:[c("admin.user_edit.balance"),": ",(0,d.jsxs)("span",{className:"font-semibold text-gray-700",children:[Number(b1.balance??0).toFixed(2)," EUR"]})]}),(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:`block text-sm font-medium mb-1 ${"topup"===b9?"text-emerald-800":"text-rose-800"}`,children:"topup"===b9?c("admin.balance.topup.amount"):c("admin.balance.withdraw.amount")}),(0,d.jsx)("input",{type:"number",min:"0.01",step:"0.01",value:"topup"===b9?b1.topUpAmount??"":b1.withdrawAmount??"",onChange:a=>b2(b=>"topup"===b9?{...b,topUpAmount:a.target.value}:{...b,withdrawAmount:a.target.value}),className:`w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ${"topup"===b9?"border-emerald-300 focus:ring-emerald-400":"border-rose-300 focus:ring-rose-400"}`})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:`block text-sm font-medium mb-1 ${"topup"===b9?"text-emerald-800":"text-rose-800"}`,children:"topup"===b9?c("admin.balance.topup.description"):c("admin.balance.withdraw.description")}),(0,d.jsx)("input",{value:"topup"===b9?b1.topUpDescription??"":b1.withdrawDescription??"",onChange:a=>b2(b=>"topup"===b9?{...b,topUpDescription:a.target.value}:{...b,withdrawDescription:a.target.value}),placeholder:"topup"===b9?c("admin.balance.topup.description.placeholder"):c("admin.balance.withdraw.description.placeholder"),className:`w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ${"topup"===b9?"border-emerald-300 focus:ring-emerald-400":"border-rose-300 focus:ring-rose-400"}`})]})]}),(0,d.jsxs)("div",{className:"flex gap-2 mt-5",children:[(0,d.jsx)("button",{onClick:async()=>{"topup"===b9?await fh():await fi(),ca(null)},disabled:"topup"===b9?bZ||!Number(b1.topUpAmount):b_||!Number(b1.withdrawAmount),className:`flex-1 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50 ${"topup"===b9?"bg-emerald-600 hover:bg-emerald-700":"bg-rose-600 hover:bg-rose-700"}`,children:("topup"===b9?bZ:b_)?c("common.loading"):"topup"===b9?c("admin.balance.topup.submit"):c("admin.balance.withdraw.submit")}),(0,d.jsx)("button",{onClick:()=>ca(null),className:"flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium",children:c("common.cancel")})]})]})})]})]})]})})}function x(){let[a,b]=(0,e.useState)(!1),[c,f]=(0,e.useState)(null),[g,h]=(0,e.useState)({}),[i,j]=(0,e.useState)(null);function l(a){return a[0]?.nameEl?.toLowerCase().trim()??a[0]?.id}async function m(){b(!0),f(null),h({});try{let a=await k.GE();f(a);let b={};a.forEach(a=>{let c=[...a].sort((a,b)=>(b.usageCount??0)-(a.usageCount??0))[0];b[l(a)]=c.id}),h(b)}catch{f([])}finally{b(!1)}}async function n(a,b){let c=g[a];if(!c)return;let d=b.filter(a=>a.id!==c).map(a=>a.id);if(d.length){j(a);try{await k.Uq(c,d),f(b=>b?b.filter(b=>l(b)!==a):b)}catch{}finally{j(null)}}}async function o(){if(c?.length){for(let a of(j("__all__"),[...c])){let b=l(a),c=g[b];if(!c)continue;let d=a.filter(a=>a.id!==c).map(a=>a.id);if(d.length)try{await k.Uq(c,d),f(a=>a?a.filter(a=>l(a)!==b):a)}catch{}}j(null)}}let p=c?.reduce((a,b)=>a+b.length-1,0)??0;return(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-base font-semibold text-gray-900",children:"Проверка базы данных"}),(0,d.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:"Диагностика и исправление проблем в базе данных"})]}),(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,d.jsxs)("div",{className:"px-5 py-4 border-b border-gray-100 flex items-center justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Дубликаты навыков"}),(0,d.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:"Поиск навыков с одинаковым именем в одной категории. При объединении — ссылки в карточках специалистов обновляются автоматически."})]}),(0,d.jsxs)("button",{onClick:m,disabled:a,className:"text-sm px-4 py-2 rounded-lg bg-orange-50 text-green-700 border border-orange-200 hover:bg-green-100 font-medium flex items-center gap-2 transition disabled:opacity-50",children:[(0,d.jsxs)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,d.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-4.35-4.35"})]}),a?"Ищу…":"Найти дубликаты"]})]}),null!==c&&(0,d.jsx)("div",{className:"p-5",children:0===c.length?(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-emerald-700 bg-emerald-50 border border-emerald-200 rounded-lg px-4 py-3",children:[(0,d.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),"Дубликатов не найдено — база в порядке"]}):(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("p",{className:"text-sm text-green-700 font-semibold",children:["Найдено ",c.length," групп \xb7 ",p," лишних записей"]}),(0,d.jsx)("button",{onClick:o,disabled:"__all__"===i,className:"text-sm px-4 py-1.5 bg-red-600 text-white rounded-lg font-semibold hover:bg-red-700 disabled:opacity-50 transition",children:"__all__"===i?"Объединяю…":`Объединить все (${c.length})`})]}),c.map(a=>{let b=l(a);return(0,d.jsxs)("div",{className:"bg-white border border-orange-200 rounded-xl overflow-hidden shadow-sm",children:[(0,d.jsxs)("div",{className:"px-4 py-2.5 bg-orange-50 border-b border-orange-100 flex items-center justify-between gap-3",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("span",{className:"text-sm font-semibold text-orange-800",children:["\xab",a[0]?.nameEl,"\xbb"]}),(0,d.jsx)("span",{className:"ml-2 text-xs text-green-600 font-mono",children:a[0]?.categorySlug}),(0,d.jsxs)("span",{className:"ml-2 text-xs text-orange-400",children:[a.length," варианта"]})]}),(0,d.jsx)("button",{onClick:()=>n(b,a),disabled:!!i,className:"shrink-0 text-xs px-3 py-1 bg-orange-600 text-white rounded-lg font-semibold hover:bg-orange-700 disabled:opacity-50 transition",children:i===b?"Объединяю…":"Объединить"})]}),(0,d.jsx)("div",{className:"divide-y divide-gray-50",children:a.map(a=>(0,d.jsxs)("label",{className:"flex items-center gap-3 px-4 py-2.5 cursor-pointer hover:bg-gray-50 transition",children:[(0,d.jsx)("input",{type:"radio",name:`dedup-global-${b}`,checked:g[b]===a.id,onChange:()=>h(c=>({...c,[b]:a.id})),className:"accent-amber-600 shrink-0"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-gray-800",children:a.nameEl}),a.nameEn&&a.nameEn!==a.nameEl&&(0,d.jsxs)("span",{className:"text-xs text-gray-400",children:["EN: ",a.nameEn]}),a.nameRu&&a.nameRu!==a.nameEl&&(0,d.jsxs)("span",{className:"text-xs text-gray-400",children:["RU: ",a.nameRu]}),a.nameUk&&(0,d.jsxs)("span",{className:"text-xs text-gray-400",children:["UK: ",a.nameUk]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3 mt-0.5",children:[(0,d.jsx)("span",{className:`text-[11px] font-semibold ${a.usageCount>0?"text-green-600":"text-gray-400"}`,children:a.usageCount>0?`${a.usageCount} использований`:"не использовался"}),(0,d.jsxs)("span",{className:"text-[11px] text-gray-300",children:["order: ",a.order]}),g[b]===a.id&&(0,d.jsx)("span",{className:"text-[11px] font-bold text-amber-600 uppercase",children:"← оставить"})]})]})]},a.id))})]},b)})]})})]})]})}function y({rows:a,parentId:b,depth:c,locale:e,expanded:f,onToggle:g,onEdit:h,onDelete:i,onAddChild:j,t:k}){let l=a.filter(a=>(a.parentId??null)===b);return 0===l.length?null:(0,d.jsx)(d.Fragment,{children:l.sort((a,b)=>(a.order??0)-(b.order??0)).map(b=>{let l=a.some(a=>a.parentId===b.id),m=f.has(b.id),n=("en"===e?b.nameEn:"ru"===e?b.nameRu:"uk"===e?b.nameUk:b.nameEl)||b.nameEl||b.slug;return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:`flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ${!b.isActive?"opacity-50":""}`,style:{paddingLeft:`${16+24*c}px`},children:[(0,d.jsx)("button",{onClick:()=>l&&g(b.id),className:`w-5 h-5 flex items-center justify-center text-gray-400 rounded ${l?"hover:bg-gray-200 cursor-pointer":"cursor-default"}`,children:l?m?(0,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("polyline",{points:"6 9 12 15 18 9"})}):(0,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("polyline",{points:"9 18 15 12 9 6"})}):(0,d.jsx)("span",{className:"w-3.5 h-3.5 block"})}),0===c?(0,d.jsx)("svg",{className:"w-5 h-5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"})}):(0,d.jsxs)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[(0,d.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,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("span",{className:"font-medium text-gray-800 text-sm",children:n}),(0,d.jsx)("span",{className:"ml-2 text-xs text-gray-400",children:b.nameEn}),(0,d.jsxs)("span",{className:"ml-1.5 font-mono text-xs text-gray-300",children:["/",b.slug]})]}),(0,d.jsx)("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${b.isActive?"bg-green-100 text-green-700":"bg-gray-100 text-gray-500"}`,children:b.isActive?k("admin.cat.active"):k("admin.cat.inactive")}),(0,d.jsxs)("div",{className:"flex gap-1 flex-shrink-0",children:[0===c&&(0,d.jsx)("button",{onClick:()=>j(b.id),className:"text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium",title:k("admin.loc.add_district"),children:"+"}),(0,d.jsx)("button",{onClick:()=>h(b),className:"text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium",children:k("common.edit")}),(0,d.jsx)("button",{onClick:()=>i(b.id,n),className:"text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium",children:k("common.delete")})]})]}),l&&m&&(0,d.jsx)(y,{rows:a,parentId:b.id,depth:c+1,locale:e,expanded:f,onToggle:g,onEdit:h,onDelete:i,onAddChild:j,t:k})]},b.id)})})}function z({rows:a,parentId:b,depth:c,locale:e,expanded:f,onToggle:g,onEdit:h,onDelete:i,onAddChild:j,skillsExpanded:k,skillsCache:l,skillsLoading:m,onToggleSkills:o,skillForm:p,skillSaving:q,onOpenAddSkill:r,onOpenEditSkill:s,onSaveSkill:t,onDeleteSkill:u,onCancelSkillForm:v,onSkillFormChange:w,t:x}){let y=a.filter(a=>(a.parentId??null)===b);return 0===y.length?null:(0,d.jsx)(d.Fragment,{children:y.sort((a,b)=>(a.order??0)-(b.order??0)).map(b=>{let y=a.some(a=>a.parentId===b.id),A=f.has(b.id),B=k.has(b.id),D=m.has(b.id),E=l[b.slug]??[],F=("en"===e?b.namesEn:"ru"===e?b.namesRu:"uk"===e?b.namesUk:b.namesEl)||b.namesEl||b.slug;return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:`flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ${!b.isActive?"opacity-50":""}`,style:{paddingLeft:`${16+24*c}px`},children:[(0,d.jsx)("button",{onClick:()=>y&&g(b.id),className:`w-5 h-5 flex items-center justify-center text-gray-400 rounded ${y?"hover:bg-gray-200 cursor-pointer":"cursor-default"}`,children:y?A?(0,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("polyline",{points:"6 9 12 15 18 9"})}):(0,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("polyline",{points:"9 18 15 12 9 6"})}):(0,d.jsx)("span",{className:"w-3.5 h-3.5 block"})}),(0,d.jsx)("span",{className:"w-10 h-10 flex items-center justify-center rounded-xl bg-green-50",children:(0,d.jsx)(n.Ez,{icon:b.icon,alt:F,className:"h-7 w-7 object-contain text-2xl leading-none",fallback:"\uD83D\uDCE6"})}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("span",{className:"font-medium text-gray-800 text-sm",children:F}),(0,d.jsx)("span",{className:"ml-2 text-xs text-gray-400",children:b.namesEn||b.names?.en}),(0,d.jsxs)("span",{className:"ml-1.5 font-mono text-xs text-gray-300",children:["/",b.slug]})]}),(0,d.jsx)("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${b.isActive?"bg-green-100 text-green-700":"bg-gray-100 text-gray-500"}`,children:b.isActive?x("admin.cat.active"):x("admin.cat.inactive")}),(0,d.jsxs)("div",{className:"flex gap-1 flex-shrink-0",children:[(0,d.jsxs)("button",{onClick:()=>o(b),className:`text-xs px-2 py-1 rounded-lg font-medium flex items-center gap-1 ${B?"bg-amber-100 text-amber-700":"bg-amber-50 text-amber-600 hover:bg-amber-100"}`,title:"Навыки",children:[(0,d.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.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"})}),l[b.slug]?l[b.slug].length:x("admin.cat.skills","Skills")]}),(0,d.jsx)("button",{onClick:()=>j(b.id),className:"text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium",title:x("admin.cat.add_child"),children:"+"}),(0,d.jsx)("button",{onClick:()=>h(b),className:"text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium",children:x("common.edit")}),(0,d.jsx)("button",{onClick:()=>i(b.id,F),className:"text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium",children:x("common.delete")})]})]}),B&&(0,d.jsx)(C,{cat:b,locale:e,depth:c,t:x,skills:E,isLoading:D,skillForm:p,skillSaving:q,onOpenAddSkill:r,onOpenEditSkill:s,onSaveSkill:t,onDeleteSkill:u,onCancelSkillForm:v,onSkillFormChange:w}),y&&A&&(0,d.jsx)(z,{rows:a,parentId:b.id,depth:c+1,locale:e,expanded:f,onToggle:g,onEdit:h,onDelete:i,onAddChild:j,skillsExpanded:k,skillsCache:l,skillsLoading:m,onToggleSkills:o,skillForm:p,skillSaving:q,onOpenAddSkill:r,onOpenEditSkill:s,onSaveSkill:t,onDeleteSkill:u,onCancelSkillForm:v,onSkillFormChange:w,t:x})]},b.id)})})}let A={nameEl:"\uD83C\uDDEC\uD83C\uDDF7 EL",nameEn:"\uD83C\uDDEC\uD83C\uDDE7 EN",nameRu:"\uD83C\uDDF7\uD83C\uDDFA RU",nameUk:"\uD83C\uDDFA\uD83C\uDDE6 UK"};function B({form:a,saving:b,onSave:c,onCancel:e,onChange:f}){return(0,d.jsxs)("div",{className:"bg-white border border-amber-200 rounded-xl p-4 shadow-sm",children:[(0,d.jsx)("div",{className:"grid grid-cols-2 gap-3 mb-3",children:["nameEl","nameEn","nameRu","nameUk"].map((b,c)=>(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-[11px] font-semibold text-gray-500 mb-1 uppercase tracking-wide",children:A[b]}),(0,d.jsx)("input",{value:a[b]??"",onChange:c=>f({...a,[b]:c.target.value}),className:"w-full border border-gray-200 rounded-lg px-2.5 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-amber-400 focus:border-transparent transition",autoFocus:0===c,placeholder:"nameUk"===b?"необовʼязково":""})]},b))}),(0,d.jsxs)("div",{className:"flex items-center gap-3 pt-1 border-t border-gray-100",children:[(0,d.jsx)("label",{className:"text-xs text-gray-400 font-medium",children:"Порядок"}),(0,d.jsx)("input",{type:"number",value:a.order??0,onChange:b=>f({...a,order:Number(b.target.value)}),className:"w-16 border border-gray-200 rounded-lg px-2 py-1 text-xs text-center"}),(0,d.jsxs)("div",{className:"flex gap-2 ml-auto",children:[(0,d.jsx)("button",{onClick:e,className:"px-3 py-1.5 bg-gray-100 text-gray-600 rounded-lg text-xs font-medium hover:bg-gray-200 transition",children:"Отмена"}),(0,d.jsx)("button",{onClick:c,disabled:b||!a.nameEl?.trim(),className:"px-4 py-1.5 bg-amber-600 text-white rounded-lg text-xs font-semibold hover:bg-amber-700 disabled:opacity-40 transition",children:b?"Сохраняю…":"Сохранить"})]})]})]})}function C({cat:a,locale:b,depth:c,t:e,skills:f,isLoading:g,skillForm:h,skillSaving:i,onOpenAddSkill:j,onOpenEditSkill:k,onSaveSkill:l,onDeleteSkill:m,onCancelSkillForm:n,onSkillFormChange:o}){let p=h?.catSlug===a.slug&&!h?.id;return(0,d.jsxs)("div",{className:"border-t border-amber-100 bg-gradient-to-b from-amber-50/60 to-white",style:{paddingLeft:`${16+24*c+36}px`,paddingRight:"16px",paddingTop:"14px",paddingBottom:"14px"},children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,d.jsx)("span",{className:"text-xs font-bold text-amber-700 uppercase tracking-wider",children:"Навыки"}),(0,d.jsxs)("span",{className:"text-xs text-amber-500 font-mono",children:["/",a.slug]}),(0,d.jsxs)("span",{className:"ml-1 text-xs text-amber-400",children:["(",f.length,")"]}),(0,d.jsx)("div",{className:"ml-auto",children:(0,d.jsxs)("button",{onClick:()=>{n(),j(a.slug)},className:"text-xs px-2.5 py-1 rounded-lg bg-amber-600 text-white hover:bg-amber-700 font-semibold flex items-center gap-1 transition",children:[(0,d.jsxs)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,d.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,d.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"Добавить"]})})]}),g?(0,d.jsxs)("div",{className:"flex items-center gap-2 py-3 text-xs text-gray-400",children:[(0,d.jsxs)("svg",{className:"w-3.5 h-3.5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",className:"opacity-25"}),(0,d.jsx)("path",{fill:"currentColor",d:"M4 12a8 8 0 018-8v8z",className:"opacity-75"})]}),"Загрузка…"]}):(0,d.jsxs)("div",{className:"space-y-1",children:[0===f.length&&!p&&(0,d.jsx)("p",{className:"text-xs text-gray-400 italic py-2",children:"Навыки не добавлены"}),f.map(c=>{let f=h?.id===c.id,g="en"===b?c.nameEn:"ru"===b?c.nameRu:"uk"===b?c.nameUk||c.nameEn:c.nameEl;return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:`flex items-center gap-2 rounded-lg px-3 py-2 group transition ${f?"bg-amber-50 border border-amber-200":"bg-white border border-gray-100 hover:border-amber-200 hover:bg-amber-50/30"}`,children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-gray-800",children:g}),"en"!==b&&c.nameEn&&(0,d.jsx)("span",{className:"ml-2 text-xs text-gray-400",children:c.nameEn}),"ru"!==b&&c.nameRu&&c.nameRu!==c.nameEl&&(0,d.jsx)("span",{className:"ml-1.5 text-xs text-gray-300",children:c.nameRu})]}),c.order>0&&(0,d.jsxs)("span",{className:"text-[10px] text-gray-300 font-mono",children:["#",c.order]}),(0,d.jsxs)("div",{className:`flex gap-1 transition-opacity ${f?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:[(0,d.jsx)("button",{onClick:()=>f?n():(n(),k(c,a.slug)),className:`text-xs px-2 py-0.5 rounded-md font-medium transition ${f?"bg-amber-100 text-amber-700":"bg-gray-100 text-gray-600 hover:bg-amber-100 hover:text-amber-700"}`,children:f?"✕":e("common.edit")}),(0,d.jsx)("button",{onClick:()=>m(c,a.slug),className:"text-xs px-2 py-0.5 rounded-md bg-red-50 text-red-600 hover:bg-red-100 transition",children:e("common.delete")})]})]}),f&&(0,d.jsx)("div",{className:"mt-1 mb-1 ml-0",children:(0,d.jsx)(B,{form:h,saving:i,onSave:l,onCancel:n,onChange:o})})]},c.id)}),p&&(0,d.jsx)("div",{className:"mt-2",children:(0,d.jsx)(B,{form:h,saving:i,onSave:l,onCancel:n,onChange:o})})]})]})}function D({page:a,total:b,limit:c,onChange:e,totalLabel:f}){let g=Math.ceil(b/c);return g<=1?null:(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-100 text-sm text-gray-500",children:[(0,d.jsxs)("span",{children:[f,": ",b]}),(0,d.jsxs)("div",{className:"flex gap-1",children:[(0,d.jsx)("button",{onClick:()=>e(a-1),disabled:1===a,className:"px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50",children:"←"}),(0,d.jsxs)("span",{className:"px-3 py-1",children:[a," / ",g]}),(0,d.jsx)("button",{onClick:()=>e(a+1),disabled:a>=g,className:"px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50",children:"→"})]})]})}function E(a){try{return a?JSON.parse(a):null}catch{return null}}let F={"user.login":{icon:(0,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.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"})}),labelKey:"admin.event.user_login",color:"bg-green-50 text-green-700 border-green-100"},"user.register":{icon:(0,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z"})}),labelKey:"admin.event.user_register",color:"bg-green-50 text-green-700 border-green-100"},"admin.user.deactivate":{icon:(0,d.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("line",{x1:"4.93",y1:"4.93",x2:"19.07",y2:"19.07"})]}),labelKey:"admin.event.admin_user_deactivate",color:"bg-red-50 text-red-700 border-red-100"},"admin.user.activate":{icon:(0,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),labelKey:"admin.event.admin_user_activate",color:"bg-emerald-50 text-emerald-700 border-emerald-100"},"admin.user.role_changed":{icon:(0,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"})}),labelKey:"admin.event.admin_user_role_changed",color:"bg-purple-50 text-purple-700 border-purple-100"},"admin.task.cancelled":{icon:(0,d.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),(0,d.jsx)("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]}),labelKey:"admin.event.admin_task_cancelled",color:"bg-orange-50 text-green-700 border-orange-100"},"admin.task.deleted":{icon:(0,d.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,d.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 6l-1 14a2 2 0 01-2 2H8a2 2 0 01-2-2L5 6m5 0V4a1 1 0 011-1h2a1 1 0 011 1v2"})]}),labelKey:"admin.event.admin_task_deleted",color:"bg-red-50 text-red-700 border-red-100"},"admin.report.reviewed":{icon:(0,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("polyline",{points:"20 6 9 17 4 12"})}),labelKey:"admin.event.admin_report_reviewed",color:"bg-teal-50 text-teal-700 border-teal-100"},"admin.report.dismissed":{icon:(0,d.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,d.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,d.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),labelKey:"admin.event.admin_report_dismissed",color:"bg-gray-50 text-gray-600 border-gray-200"},"task.created":{icon:(0,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.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"})}),labelKey:"admin.event.task_created",color:"bg-indigo-50 text-indigo-700 border-indigo-100"}};function G({entry:a,dateLocale:b,onFilterUser:c,t:e}){let f=F[a.event]??{icon:(0,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.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"})}),labelKey:a.event,color:"bg-gray-50 text-gray-700 border-gray-200"},g=E(a.details);return(0,d.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 px-4 py-3 flex items-start gap-3",children:[(0,d.jsxs)("span",{className:`shrink-0 mt-0.5 px-2.5 py-1 rounded-lg border text-xs font-semibold flex items-center gap-1.5 ${f.color}`,children:[f.icon," ",e(f.labelKey,f.labelKey)]}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[a.userName&&(0,d.jsx)("button",{onClick:()=>a.userId&&c(a.userId),className:"text-sm font-medium text-gray-800 hover:text-green-600",children:a.userName}),a.userEmail&&(0,d.jsx)("span",{className:"text-xs text-gray-400",children:a.userEmail})]}),g&&Object.keys(g).length>0&&(0,d.jsx)("div",{className:"mt-1 flex flex-wrap gap-2",children:Object.entries(g).map(([a,b])=>(0,d.jsxs)("span",{className:"text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded",children:[a,": ",(0,d.jsx)("span",{className:"font-medium",children:String(b)})]},a))}),a.ipAddress&&(0,d.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:a.ipAddress})]}),(0,d.jsx)("time",{className:"shrink-0 text-xs text-gray-400 whitespace-nowrap",children:new Date(a.createdAt).toLocaleString(b)})]})}function H({series:a,dateLocale:b="en-US"}){let c=new Set;a.forEach(a=>a.data.forEach(a=>c.add(a.month)));let e=Array.from(c).sort();if(0===e.length)return null;let f=a.map(a=>{let b={};return a.data.forEach(a=>{b[a.month]=Number(a.count)}),e.map(a=>b[a]??0)}),g=Math.max(...f.flat(),1),h=g>=1e6?50:g>=1e4?44:g>=1e3?40:36;e.length,a.length;let i=(700-h-8)/e.length,j=Math.max(4,Math.min(20,i/a.length-2)),k=[0,Math.round(g/3),Math.round(2*g/3),g];return(0,d.jsx)("div",{className:"overflow-x-auto",children:(0,d.jsxs)("svg",{viewBox:"0 0 700 174",className:"w-full",style:{minWidth:Math.max(360,40*e.length)},children:[k.map((a,b)=>{let c=136-a/g*136;return(0,d.jsxs)("g",{children:[(0,d.jsx)("line",{x1:h,y1:c,x2:696,y2:c,stroke:"#f3f4f6",strokeWidth:1}),(0,d.jsx)("text",{x:h-5,y:c+3.5,textAnchor:"end",fontSize:9,fill:"#9ca3af",children:J(a)})]},b)}),e.map((b,c)=>a.map((b,e)=>{let k=f[e][c]/g*136,l=h+c*i+(i-a.length*(j+1))/2+e*(j+1);return(0,d.jsx)("rect",{x:l,y:136-k,width:j,height:k,fill:b.color,opacity:.8,rx:2},`bar-${c}-${e}`)})),e.map((a,c)=>{let[e,f]=a.slice(0,7).split("-").map(Number),g=new Date(Date.UTC(e,f-1,2)),j=new Intl.DateTimeFormat(b,{month:"short"}).format(g)+(0===c||1===f?` ${e}`:""),k=h+c*i+i/2;return(0,d.jsx)("text",{x:k,y:172,textAnchor:"middle",fontSize:9,fill:"#9ca3af",children:j},`xl-${c}`)}),(0,d.jsx)("line",{x1:h,y1:136,x2:696,y2:136,stroke:"#e5e7eb",strokeWidth:1})]})})}function I(a){if(a.length<2)return"";let b=`M ${a[0][0].toFixed(1)} ${a[0][1].toFixed(1)}`;for(let c=1;c<a.length;c++){let d=((a[c-1][0]+a[c][0])/2).toFixed(1);b+=` C ${d} ${a[c-1][1].toFixed(1)} ${d} ${a[c][1].toFixed(1)} ${a[c][0].toFixed(1)} ${a[c][1].toFixed(1)}`}return b}function J(a){return a>=1e6?`${+(a/1e6).toFixed(1)}M`:a>=1e3?`${Math.round(a/1e3)}K`:String(a)}function K({series:a,days:b}){let c=b??function(){let a=[];for(let b=29;b>=0;b--){let c=new Date(Date.now()-864e5*b);a.push(c.toISOString().slice(0,10))}return a}(),e=a.map(a=>{let b={};return a.data.forEach(a=>{b[a.day]=Number(a.count)}),c.map(a=>b[a]??0)}),f=Math.max(...e.flat(),1),g=f>=1e4?44:f>=1e3?40:36,h=(700-g-4)/(c.length-1);function i(a){return a.map((a,b)=>[g+b*h,138-a/f*138])}let j=[0,Math.round(f/3),Math.round(2*f/3),f],k=c.map((a,b)=>({i:b,label:a.slice(8)})).filter((a,b)=>b%7==0||b===c.length-1);return(0,d.jsx)("div",{className:"overflow-x-auto",children:(0,d.jsxs)("svg",{viewBox:"0 0 700 172",className:"w-full",style:{minWidth:360},children:[j.map((a,b)=>{let c=138-a/f*138;return(0,d.jsxs)("g",{children:[(0,d.jsx)("line",{x1:g,y1:c,x2:696,y2:c,stroke:"#f3f4f6",strokeWidth:1}),(0,d.jsx)("text",{x:g-5,y:c+3.5,textAnchor:"end",fontSize:9,fill:"#9ca3af",children:J(a)})]},b)}),k.map(({i:a})=>{let b=g+a*h;return(0,d.jsx)("line",{x1:b,y1:0,x2:b,y2:138,stroke:"#f9fafb",strokeWidth:1},`vg-${a}`)}),k.map(({i:a,label:b})=>(0,d.jsx)("text",{x:g+a*h,y:170,textAnchor:"middle",fontSize:9,fill:"#9ca3af",children:b},a)),a.map((a,b)=>(0,d.jsx)("path",{d:function(a){let b=i(a),c=I(b);if(!c)return"";let d=b[b.length-1][0].toFixed(1);return`${c} L ${d} 138.0 L ${g.toFixed(1)} 138.0 Z`}(e[b]),fill:a.fill},`fill-${b}`)),a.map((a,b)=>(0,d.jsx)("path",{d:I(i(e[b])),fill:"none",stroke:a.color,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},`line-${b}`)),a.map((a,b)=>{let c=i(e[b]),f=c[c.length-1];return(0,d.jsx)("g",{children:(0,d.jsx)("circle",{cx:f[0],cy:f[1],r:4,fill:"white",stroke:a.color,strokeWidth:2})},`dot-${b}`)}),(0,d.jsx)("line",{x1:g,y1:138,x2:696,y2:138,stroke:"#e5e7eb",strokeWidth:1})]})})}},79428:a=>{"use strict";a.exports=require("buffer")},79551:a=>{"use strict";a.exports=require("url")},79646:a=>{"use strict";a.exports=require("child_process")},80941:(a,b,c)=>{Promise.resolve().then(c.bind(c,74303))},81630:a=>{"use strict";a.exports=require("http")},83997:a=>{"use strict";a.exports=require("tty")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{"use strict";a.exports=require("net")},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../webpack-runtime.js");b.C(a);var c=b.X(0,[901,652,809],()=>b(b.s=33689));module.exports=c})();
Save
cmd:
run